.. | .. |
---|
22 | 22 | //static final long serialVersionUID = -607422624994562685L; |
---|
23 | 23 | static final long serialVersionUID = 5022536242724664900L; |
---|
24 | 24 | |
---|
| 25 | + // Use GetUUID for backward compatibility with null. |
---|
25 | 26 | private UUID uuid = UUID.randomUUID(); |
---|
26 | 27 | |
---|
27 | | - // TEMPORARY for mocap undo. No need to be transient. |
---|
| 28 | + // TEMPORARY for versions. No need to be transient. |
---|
28 | 29 | mocap.reader.BVHReader.BVHResult savebvh; |
---|
29 | 30 | Object3D saveskeleton; |
---|
| 31 | + |
---|
| 32 | + // FileObject |
---|
| 33 | + Object3D savefilecontent; |
---|
30 | 34 | // |
---|
31 | 35 | |
---|
32 | | - byte[] versions[]; |
---|
| 36 | + String skyboxname; |
---|
| 37 | + String skyboxext; |
---|
| 38 | + |
---|
| 39 | + Object3D[] versionlist; |
---|
33 | 40 | int versionindex = -1; |
---|
34 | 41 | |
---|
| 42 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 43 | + |
---|
35 | 44 | ScriptNode scriptnode; |
---|
36 | 45 | |
---|
| 46 | + void deepCopyNode(Object3D other) |
---|
| 47 | + { |
---|
| 48 | + other.skyboxname = skyboxname; |
---|
| 49 | + other.skyboxext = skyboxext; |
---|
| 50 | + |
---|
| 51 | + if (toParent != null) |
---|
| 52 | + { |
---|
| 53 | + other.toParent = LA.newMatrix(); |
---|
| 54 | + other.fromParent = LA.newMatrix(); |
---|
| 55 | + LA.matCopy(toParent, other.toParent); |
---|
| 56 | + LA.matCopy(fromParent, other.fromParent); |
---|
| 57 | + if (toParentMarked != null) |
---|
| 58 | + { |
---|
| 59 | + other.toParentMarked = LA.newMatrix(); |
---|
| 60 | + other.fromParentMarked = LA.newMatrix(); |
---|
| 61 | + LA.matCopy(toParentMarked, other.toParentMarked); |
---|
| 62 | + LA.matCopy(fromParentMarked, other.fromParentMarked); |
---|
| 63 | + } |
---|
| 64 | + } |
---|
| 65 | + else |
---|
| 66 | + { |
---|
| 67 | + if (other.toParent == null) |
---|
| 68 | +// assert(other.toParent == null); |
---|
| 69 | +// new Exception().printStackTrace(); |
---|
| 70 | + System.err.println("null parent: " + other); |
---|
| 71 | + } |
---|
| 72 | + |
---|
| 73 | + /* |
---|
| 74 | + double ident[][] = LA.newMatrix(); |
---|
| 75 | + if (bRep == null) |
---|
| 76 | + other.bRep = null; |
---|
| 77 | + else |
---|
| 78 | + other.bRep = new BoundaryRep(bRep, ident); |
---|
| 79 | + */ |
---|
| 80 | + // Really new... |
---|
| 81 | + //other.editWindow = null; |
---|
| 82 | + if (name == null) |
---|
| 83 | + other.name = null; |
---|
| 84 | + else |
---|
| 85 | + other.name = new String(name); |
---|
| 86 | + |
---|
| 87 | + if (material != null) |
---|
| 88 | + { |
---|
| 89 | + other.material = new cMaterial(material); |
---|
| 90 | + } else |
---|
| 91 | + { |
---|
| 92 | + other.material = null; |
---|
| 93 | + } |
---|
| 94 | + |
---|
| 95 | + other.GetTextures().name = GetTextures().name; |
---|
| 96 | + |
---|
| 97 | + CopyExtraMaterial(other); |
---|
| 98 | + |
---|
| 99 | + other.touched = touched; |
---|
| 100 | + other.softtouched = softtouched; |
---|
| 101 | + |
---|
| 102 | + other.random = random; |
---|
| 103 | + other.link2master = link2master; |
---|
| 104 | + other.transformcount = transformcount; |
---|
| 105 | + other.marked = marked; |
---|
| 106 | + other.skip = skip; |
---|
| 107 | + other.count = count; |
---|
| 108 | + other.flipV = flipV; |
---|
| 109 | + other.live = live; |
---|
| 110 | + other.rewind = rewind; |
---|
| 111 | + other.hide = hide; |
---|
| 112 | + other.texres = texres; |
---|
| 113 | + other.speedup = speedup; |
---|
| 114 | + other.height = height; |
---|
| 115 | + other.depth = depth; |
---|
| 116 | + } |
---|
| 117 | + |
---|
| 118 | + int VersionCount() |
---|
| 119 | + { |
---|
| 120 | + int count = 0; |
---|
| 121 | + |
---|
| 122 | + if (versionlist != null) |
---|
| 123 | + for (int i = versionlist.length; --i >= 0;) |
---|
| 124 | + { |
---|
| 125 | + if (versionlist[i] != null) |
---|
| 126 | + count++; |
---|
| 127 | + } |
---|
| 128 | + |
---|
| 129 | + return count; |
---|
| 130 | + } |
---|
| 131 | + |
---|
37 | 132 | void InitOthers() |
---|
38 | 133 | { |
---|
39 | 134 | if (projectedVertices == null || projectedVertices.length <= 2) |
---|
.. | .. |
---|
45 | 140 | projectedVertices[i] = new cVector2(); // Others |
---|
46 | 141 | } |
---|
47 | 142 | projectedVertices[0].x = 100; // bump |
---|
| 143 | + projectedVertices[1].y = 1000; // punchthrough. only for png |
---|
48 | 144 | } |
---|
49 | 145 | |
---|
50 | 146 | void MinMax(cVector minima, cVector maxima) |
---|
.. | .. |
---|
171 | 267 | } |
---|
172 | 268 | } |
---|
173 | 269 | |
---|
| 270 | + boolean HasBigData() |
---|
| 271 | + { |
---|
| 272 | + if (blockloop) |
---|
| 273 | + return false; |
---|
| 274 | + |
---|
| 275 | + if (bRep != null) |
---|
| 276 | + { |
---|
| 277 | + return true; |
---|
| 278 | + } |
---|
| 279 | + |
---|
| 280 | + blockloop = true; |
---|
| 281 | + |
---|
| 282 | + for (int i = 0; i < Size(); i++) |
---|
| 283 | + { |
---|
| 284 | + Object3D child = (Object3D) get(i); |
---|
| 285 | + if (child == null) |
---|
| 286 | + continue; |
---|
| 287 | + if (child.HasBigData()) |
---|
| 288 | + { |
---|
| 289 | + blockloop = false; |
---|
| 290 | + return true; |
---|
| 291 | + } |
---|
| 292 | + } |
---|
| 293 | + |
---|
| 294 | + blockloop = false; |
---|
| 295 | + return false; |
---|
| 296 | + } |
---|
| 297 | + |
---|
174 | 298 | void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
175 | 299 | { |
---|
| 300 | + if (blockloop) |
---|
| 301 | + return; |
---|
| 302 | + |
---|
176 | 303 | Object3D o; |
---|
| 304 | + |
---|
| 305 | + boolean isnew = false; |
---|
177 | 306 | |
---|
178 | 307 | if (hashtable.containsKey(GetUUID())) |
---|
179 | 308 | { |
---|
.. | .. |
---|
187 | 316 | } |
---|
188 | 317 | else |
---|
189 | 318 | { |
---|
| 319 | + isnew = true; |
---|
| 320 | + |
---|
190 | 321 | o = new Object3D("copy of " + this.name); |
---|
191 | 322 | |
---|
192 | 323 | hashtable.put(GetUUID(), o); |
---|
193 | 324 | } |
---|
194 | 325 | |
---|
195 | | - if (!blockloop) |
---|
| 326 | + //if (!blockloop) |
---|
196 | 327 | { |
---|
197 | 328 | blockloop = true; |
---|
198 | 329 | |
---|
.. | .. |
---|
203 | 334 | |
---|
204 | 335 | blockloop = false; |
---|
205 | 336 | } |
---|
206 | | - |
---|
207 | | - ExtractBigData(o); |
---|
| 337 | + |
---|
| 338 | + //if (isnew) |
---|
| 339 | + ExtractBigData(o); |
---|
208 | 340 | } |
---|
209 | 341 | |
---|
210 | 342 | void ExtractBigData(Object3D o) |
---|
211 | 343 | { |
---|
| 344 | + //System.err.println("ExtractBigData : " + this + " --> " + o); |
---|
| 345 | + |
---|
212 | 346 | if (o.bRep != null) |
---|
213 | 347 | Grafreed.Assert(o.bRep == this.bRep); |
---|
214 | 348 | |
---|
.. | .. |
---|
219 | 353 | // o.bRep.support = null; |
---|
220 | 354 | // } |
---|
221 | 355 | o.selection = this.selection; |
---|
222 | | - o.versions = this.versions; |
---|
223 | | - o.versionindex = this.versionindex; |
---|
| 356 | + //o.versionlist = this.versionlist; |
---|
| 357 | + //o.versionindex = this.versionindex; |
---|
224 | 358 | |
---|
225 | 359 | if (this.support != null) |
---|
226 | 360 | { |
---|
.. | .. |
---|
243 | 377 | // this.fileparent = null; |
---|
244 | 378 | } |
---|
245 | 379 | |
---|
| 380 | +// Object3D GetObject(java.util.UUID uuid) |
---|
| 381 | +// { |
---|
| 382 | +// if (this.uuid.equals(uuid)) |
---|
| 383 | +// return this; |
---|
| 384 | +// |
---|
| 385 | +// if (blockloop) |
---|
| 386 | +// return null; |
---|
| 387 | +// |
---|
| 388 | +// blockloop = true; |
---|
| 389 | +// |
---|
| 390 | +// for (int i=0; i<Size(); i++) |
---|
| 391 | +// { |
---|
| 392 | +// Object3D o = get(i).GetObject(uuid); |
---|
| 393 | +// |
---|
| 394 | +// if (o != null) |
---|
| 395 | +// return o; |
---|
| 396 | +// } |
---|
| 397 | +// |
---|
| 398 | +// blockloop = false; |
---|
| 399 | +// |
---|
| 400 | +// return null; |
---|
| 401 | +// } |
---|
| 402 | + |
---|
| 403 | + transient boolean tag; |
---|
| 404 | + |
---|
| 405 | + void TagObjects(Object3D o, boolean tag) |
---|
| 406 | + { |
---|
| 407 | + if (blockloop) |
---|
| 408 | + return; |
---|
| 409 | + |
---|
| 410 | + o.tag = tag; |
---|
| 411 | + |
---|
| 412 | + if (o == this) |
---|
| 413 | + return; |
---|
| 414 | + |
---|
| 415 | + blockloop = true; |
---|
| 416 | + |
---|
| 417 | + for (int i=0; i<Size(); i++) |
---|
| 418 | + { |
---|
| 419 | + get(i).TagObjects(o, tag); |
---|
| 420 | + } |
---|
| 421 | + |
---|
| 422 | + blockloop = false; |
---|
| 423 | + } |
---|
| 424 | + |
---|
| 425 | + boolean HasTags() |
---|
| 426 | + { |
---|
| 427 | + if (blockloop) |
---|
| 428 | + return false; |
---|
| 429 | + |
---|
| 430 | + blockloop = true; |
---|
| 431 | + |
---|
| 432 | + boolean hasTags = false; |
---|
| 433 | + |
---|
| 434 | + for (int i=0; i<Size(); i++) |
---|
| 435 | + { |
---|
| 436 | + hasTags |= get(i).tag || get(i).HasTags(); |
---|
| 437 | + |
---|
| 438 | + if (hasTags) |
---|
| 439 | + break; |
---|
| 440 | + } |
---|
| 441 | + |
---|
| 442 | + blockloop = false; |
---|
| 443 | + |
---|
| 444 | + return hasTags; |
---|
| 445 | + } |
---|
| 446 | + |
---|
246 | 447 | void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
247 | 448 | { |
---|
| 449 | + if (blockloop) |
---|
| 450 | + return; |
---|
| 451 | + |
---|
248 | 452 | if (!hashtable.containsKey(GetUUID())) |
---|
249 | 453 | return; |
---|
250 | 454 | |
---|
251 | 455 | Object3D o = hashtable.get(GetUUID()); |
---|
252 | 456 | |
---|
253 | 457 | RestoreBigData(o); |
---|
254 | | - |
---|
255 | | - if (blockloop) |
---|
256 | | - return; |
---|
257 | 458 | |
---|
258 | 459 | blockloop = true; |
---|
259 | 460 | |
---|
.. | .. |
---|
269 | 470 | |
---|
270 | 471 | void RestoreBigData(Object3D o) |
---|
271 | 472 | { |
---|
| 473 | + //System.err.println("RestoreBigData : " + this + " <-- " + o); |
---|
| 474 | + Grafreed.Assert(this.bRep == null); |
---|
| 475 | + |
---|
272 | 476 | this.bRep = o.bRep; |
---|
273 | 477 | if (this.support != null && o.transientrep != null) |
---|
274 | 478 | { |
---|
.. | .. |
---|
277 | 481 | |
---|
278 | 482 | this.selection = o.selection; |
---|
279 | 483 | |
---|
280 | | - this.versions = o.versions; |
---|
281 | | - this.versionindex = o.versionindex; |
---|
| 484 | + //this.versionlist = o.versionlist; |
---|
| 485 | + //this.versionindex = o.versionindex; |
---|
282 | 486 | // July 2019 if (this.bRep != null) |
---|
283 | 487 | // this.bRep.support = o.transientrep; |
---|
284 | 488 | // this.support = o.support; |
---|
.. | .. |
---|
438 | 642 | boolean speedup = false; |
---|
439 | 643 | boolean rewind = false; |
---|
440 | 644 | |
---|
| 645 | + // Option to sort triangles, e.g. for transparency. |
---|
| 646 | + boolean sort = false; |
---|
| 647 | + |
---|
441 | 648 | float NORMALPUSH = 0; |
---|
442 | 649 | |
---|
443 | 650 | Object3D support; |
---|
.. | .. |
---|
455 | 662 | { |
---|
456 | 663 | sorted = true; |
---|
457 | 664 | |
---|
458 | | - for (int i=0; i<size()-1; i++) |
---|
| 665 | + for (int i=0; i<Size()-1; i++) |
---|
459 | 666 | { |
---|
460 | 667 | Object3D obji = get(i); |
---|
461 | 668 | Object3D objj = get(i+1); |
---|
.. | .. |
---|
479 | 686 | { |
---|
480 | 687 | sorted = true; |
---|
481 | 688 | |
---|
482 | | - for (int i=0; i<size()-1; i++) |
---|
| 689 | + for (int i=0; i<Size()-1; i++) |
---|
483 | 690 | { |
---|
484 | 691 | Object3D obji = get(i); |
---|
485 | 692 | Object3D objj = get(i+1); |
---|
.. | .. |
---|
495 | 702 | } |
---|
496 | 703 | } |
---|
497 | 704 | |
---|
498 | | - int memorysize; |
---|
| 705 | + transient int memorysize; // needs to be transient, dunno why |
---|
499 | 706 | |
---|
500 | 707 | int MemorySize() |
---|
501 | 708 | { |
---|
502 | | - if (true) // memorysize == 0) |
---|
| 709 | + if (memorysize == 0) |
---|
503 | 710 | { |
---|
504 | 711 | try |
---|
505 | 712 | { |
---|
.. | .. |
---|
614 | 821 | { |
---|
615 | 822 | if (maxcount != 1) |
---|
616 | 823 | { |
---|
617 | | - new Exception().printStackTrace(); |
---|
| 824 | + //new Exception().printStackTrace(); |
---|
618 | 825 | } |
---|
619 | 826 | |
---|
620 | 827 | toParentMarked = LA.newMatrix(); |
---|
.. | .. |
---|
1009 | 1216 | { |
---|
1010 | 1217 | // return true; |
---|
1011 | 1218 | |
---|
1012 | | - if (material == null || material.multiply) |
---|
1013 | | - return true; |
---|
| 1219 | +// if (material == null || material.multiply) |
---|
| 1220 | +// return true; |
---|
| 1221 | +// |
---|
| 1222 | +// if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
| 1223 | +// return false; |
---|
| 1224 | +// |
---|
| 1225 | +// // Transparent objects are dynamic because we have to sort the triangles. |
---|
| 1226 | +// return material.opacity > 0.99; |
---|
1014 | 1227 | |
---|
1015 | | - // Transparent objects are dynamic because we have to sort the triangles. |
---|
1016 | | - return material.opacity > 0.99; |
---|
| 1228 | + return !sort; |
---|
1017 | 1229 | } |
---|
1018 | 1230 | |
---|
1019 | 1231 | boolean IsOpaque() |
---|
1020 | 1232 | { |
---|
1021 | 1233 | // return true; |
---|
1022 | 1234 | |
---|
1023 | | - if (material == null || material.multiply) |
---|
1024 | | - return true; |
---|
| 1235 | +// if (material == null || material.multiply) |
---|
| 1236 | +// return true; |
---|
| 1237 | +// |
---|
| 1238 | +// return material.opacity > 0.99; |
---|
1025 | 1239 | |
---|
1026 | | - return material.opacity > 0.99; |
---|
| 1240 | + return !sort; |
---|
1027 | 1241 | } |
---|
1028 | 1242 | |
---|
1029 | 1243 | Object3D() |
---|
.. | .. |
---|
1101 | 1315 | |
---|
1102 | 1316 | // will share the geometry |
---|
1103 | 1317 | assert (!(this instanceof Composite)); |
---|
1104 | | - return deepCopy(); // Never called for Composite |
---|
1105 | | - |
---|
| 1318 | + |
---|
| 1319 | + Object3D obj = deepCopy(); // Never called for Composite |
---|
| 1320 | + obj.count = 2; |
---|
| 1321 | + return obj; |
---|
1106 | 1322 | } |
---|
1107 | 1323 | |
---|
1108 | 1324 | boolean HasLoops() |
---|
.. | .. |
---|
1110 | 1326 | return false; |
---|
1111 | 1327 | } |
---|
1112 | 1328 | |
---|
| 1329 | + void ResetUUIDs() |
---|
| 1330 | + { |
---|
| 1331 | + if (blockloop) |
---|
| 1332 | + { |
---|
| 1333 | + return; |
---|
| 1334 | + } |
---|
| 1335 | + |
---|
| 1336 | + this.uuid = null; |
---|
| 1337 | + |
---|
| 1338 | + blockloop = true; |
---|
| 1339 | + |
---|
| 1340 | + for (int i = 0; i < Size(); i++) |
---|
| 1341 | + { |
---|
| 1342 | + Object3D obj = (Object3D) Children().get(i); |
---|
| 1343 | + |
---|
| 1344 | + if (obj != null) |
---|
| 1345 | + { |
---|
| 1346 | + obj.ResetUUIDs(); |
---|
| 1347 | + } |
---|
| 1348 | + } |
---|
| 1349 | + |
---|
| 1350 | + blockloop = false; |
---|
| 1351 | + } |
---|
| 1352 | + |
---|
1113 | 1353 | boolean IsInfinite() |
---|
1114 | 1354 | { |
---|
1115 | 1355 | if (blockloop) |
---|
.. | .. |
---|
1180 | 1420 | return; |
---|
1181 | 1421 | |
---|
1182 | 1422 | blockloop = true; |
---|
| 1423 | + |
---|
| 1424 | + other.parent = parent; |
---|
| 1425 | + |
---|
1183 | 1426 | //System.out.println("COPY " + this + " to " + other); |
---|
1184 | 1427 | //new Exception().printStackTrace(); |
---|
| 1428 | + deepCopyNode(other); |
---|
1185 | 1429 | |
---|
1186 | | - other.parent = parent; |
---|
1187 | | - if (toParent != null) |
---|
1188 | | - { |
---|
1189 | | - other.toParent = LA.newMatrix(); |
---|
1190 | | - other.fromParent = LA.newMatrix(); |
---|
1191 | | - LA.matCopy(toParent, other.toParent); |
---|
1192 | | - LA.matCopy(fromParent, other.fromParent); |
---|
1193 | | - if (toParentMarked != null) |
---|
1194 | | - { |
---|
1195 | | - other.toParentMarked = LA.newMatrix(); |
---|
1196 | | - other.fromParentMarked = LA.newMatrix(); |
---|
1197 | | - LA.matCopy(toParentMarked, other.toParentMarked); |
---|
1198 | | - LA.matCopy(fromParentMarked, other.fromParentMarked); |
---|
1199 | | - } |
---|
1200 | | - } |
---|
1201 | | - else |
---|
1202 | | - { |
---|
1203 | | - if (other.toParent == null) |
---|
1204 | | -// assert(other.toParent == null); |
---|
1205 | | -// new Exception().printStackTrace(); |
---|
1206 | | - System.err.println("null parent: " + other); |
---|
1207 | | - } |
---|
1208 | | - /* |
---|
1209 | | - double ident[][] = LA.newMatrix(); |
---|
1210 | | - if (bRep == null) |
---|
1211 | | - other.bRep = null; |
---|
1212 | | - else |
---|
1213 | | - other.bRep = new BoundaryRep(bRep, ident); |
---|
1214 | | - */ |
---|
1215 | | - // Really new... |
---|
1216 | 1430 | other.bRep = bRep; // Share the geometry |
---|
1217 | 1431 | |
---|
1218 | 1432 | other.support = support; // Share the support |
---|
1219 | | - |
---|
1220 | | - //other.editWindow = null; |
---|
1221 | | - if (name == null) |
---|
1222 | | - other.name = null; |
---|
1223 | | - else |
---|
1224 | | - other.name = new String(name); |
---|
1225 | | - |
---|
1226 | | - if (material != null) |
---|
1227 | | - { |
---|
1228 | | - other.material = new cMaterial(material); |
---|
1229 | | - } else |
---|
1230 | | - { |
---|
1231 | | - other.material = null; |
---|
1232 | | - } |
---|
1233 | | - |
---|
1234 | | - other.GetTextures().name = GetTextures().name; |
---|
1235 | | - |
---|
1236 | | - CopyExtraMaterial(other); |
---|
1237 | | - |
---|
1238 | | - other.touched = touched; |
---|
1239 | | - other.softtouched = softtouched; |
---|
1240 | | - |
---|
1241 | | - other.random = random; |
---|
1242 | | - other.link2master = link2master; |
---|
1243 | | - other.transformcount = transformcount; |
---|
1244 | | - other.marked = marked; |
---|
1245 | | - other.skip = skip; |
---|
1246 | | - other.count = count; |
---|
1247 | | - other.flipV = flipV; |
---|
1248 | | - other.live = live; |
---|
1249 | | - other.rewind = rewind; |
---|
1250 | | - other.hide = hide; |
---|
1251 | | - other.texres = texres; |
---|
1252 | | - other.speedup = speedup; |
---|
1253 | | - other.height = height; |
---|
1254 | | - other.depth = depth; |
---|
1255 | 1433 | |
---|
1256 | 1434 | // aout 2013 if (/*displaylist != -1 &&*/other.displaylist != displaylist) |
---|
1257 | 1435 | // { |
---|
.. | .. |
---|
1307 | 1485 | if ((mask & GEOMETRY) != 0) |
---|
1308 | 1486 | { |
---|
1309 | 1487 | if (bRep != null) |
---|
1310 | | - bRep.overwriteThis(other.bRep==null?other.transientrep:other.bRep); |
---|
1311 | | - else |
---|
1312 | | - assert(other.bRep == null); |
---|
1313 | | - |
---|
1314 | | - if (bRep != null) |
---|
1315 | 1488 | { |
---|
| 1489 | + bRep.overwriteThis(other.bRep==null?other.transientrep:other.bRep); |
---|
1316 | 1490 | CameraPane.RemoveList(bRep.displaylist); |
---|
1317 | 1491 | bRep.displaylist = 0; // june 2013 -1; |
---|
1318 | 1492 | } |
---|
1319 | 1493 | else |
---|
1320 | | - bRep = bRep; |
---|
| 1494 | + { |
---|
| 1495 | + //assert(other.bRep == null); |
---|
| 1496 | + bRep = other.bRep; |
---|
| 1497 | + } |
---|
| 1498 | + |
---|
| 1499 | +// if (bRep != null) |
---|
| 1500 | +// { |
---|
| 1501 | +// CameraPane.RemoveList(bRep.displaylist); |
---|
| 1502 | +// bRep.displaylist = 0; // june 2013 -1; |
---|
| 1503 | +// } |
---|
| 1504 | +// else |
---|
| 1505 | +// bRep = bRep; |
---|
1321 | 1506 | } |
---|
1322 | 1507 | |
---|
1323 | 1508 | /* Use a MASK = GEO/MAT |
---|
.. | .. |
---|
2293 | 2478 | |
---|
2294 | 2479 | InitOthers(); |
---|
2295 | 2480 | |
---|
2296 | | - if (this instanceof Camera) |
---|
2297 | | - { |
---|
2298 | | - material.shift = 90; |
---|
2299 | | - } |
---|
2300 | | - |
---|
2301 | 2481 | material.multiply = multiply; |
---|
2302 | 2482 | |
---|
2303 | 2483 | if (multiply) |
---|
.. | .. |
---|
2438 | 2618 | else |
---|
2439 | 2619 | { |
---|
2440 | 2620 | //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2621 | + if (objectUI != null) |
---|
| 2622 | + ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2623 | + else |
---|
| 2624 | + //new Exception().printStackTrace(); |
---|
| 2625 | + System.err.println("objectUI is null"); |
---|
2441 | 2626 | } |
---|
2442 | 2627 | } |
---|
2443 | 2628 | |
---|
.. | .. |
---|
2567 | 2752 | private static final int editSelf = 1; |
---|
2568 | 2753 | private static final int editChild = 2; |
---|
2569 | 2754 | |
---|
2570 | | - void drawEditHandles(ClickInfo info, int level) |
---|
| 2755 | + void drawEditHandles(//ClickInfo info, |
---|
| 2756 | + int level) |
---|
2571 | 2757 | { |
---|
2572 | 2758 | if (level == 0) |
---|
2573 | 2759 | { |
---|
.. | .. |
---|
2575 | 2761 | return; |
---|
2576 | 2762 | |
---|
2577 | 2763 | Object3D selectee; |
---|
2578 | | - for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1)) |
---|
| 2764 | + for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info, |
---|
| 2765 | + level + 1)) |
---|
2579 | 2766 | { |
---|
2580 | 2767 | selectee = (Object3D) e.nextElement(); |
---|
2581 | 2768 | } |
---|
.. | .. |
---|
2583 | 2770 | } else |
---|
2584 | 2771 | { |
---|
2585 | 2772 | //super. |
---|
2586 | | - drawEditHandles0(info, level + 1); |
---|
| 2773 | + drawEditHandles0(//info, |
---|
| 2774 | + level + 1); |
---|
2587 | 2775 | } |
---|
2588 | 2776 | } |
---|
2589 | 2777 | |
---|
2590 | | - boolean doEditClick(ClickInfo info, int level) |
---|
| 2778 | + boolean doEditClick(//ClickInfo info, |
---|
| 2779 | + int level) |
---|
2591 | 2780 | { |
---|
2592 | 2781 | doSomething = 0; |
---|
2593 | 2782 | if (level == 0) |
---|
2594 | 2783 | { |
---|
2595 | | - return doParentClick(info); |
---|
| 2784 | + return doParentClick(); //info); |
---|
2596 | 2785 | } |
---|
2597 | 2786 | if (//super. |
---|
2598 | | - doEditClick0(info, level)) |
---|
| 2787 | + doEditClick0(//info, |
---|
| 2788 | + level)) |
---|
2599 | 2789 | { |
---|
2600 | 2790 | doSomething = 1; |
---|
2601 | 2791 | return true; |
---|
.. | .. |
---|
2605 | 2795 | } |
---|
2606 | 2796 | } |
---|
2607 | 2797 | |
---|
2608 | | - boolean doParentClick(ClickInfo info) |
---|
| 2798 | + boolean doParentClick() //ClickInfo info) |
---|
2609 | 2799 | { |
---|
2610 | 2800 | if (selection == null) |
---|
2611 | 2801 | { |
---|
.. | .. |
---|
2618 | 2808 | for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();) |
---|
2619 | 2809 | { |
---|
2620 | 2810 | Object3D selectee = (Object3D) e.nextElement(); |
---|
2621 | | - if (selectee.doEditClick(info, 1)) |
---|
| 2811 | + if (selectee.doEditClick(//info, |
---|
| 2812 | + 1)) |
---|
2622 | 2813 | { |
---|
2623 | 2814 | childToDrag = selectee; |
---|
2624 | 2815 | doSomething = 2; |
---|
.. | .. |
---|
2630 | 2821 | return retval; |
---|
2631 | 2822 | } |
---|
2632 | 2823 | |
---|
2633 | | - void doEditDrag(ClickInfo info, boolean opposite) |
---|
| 2824 | + void doEditDrag(//ClickInfo clickInfo, |
---|
| 2825 | + boolean opposite) |
---|
2634 | 2826 | { |
---|
2635 | 2827 | switch (doSomething) |
---|
2636 | 2828 | { |
---|
2637 | 2829 | case 1: // '\001' |
---|
2638 | 2830 | //super. |
---|
2639 | | - doEditDrag0(info, opposite); |
---|
| 2831 | + doEditDrag0(//clickInfo, |
---|
| 2832 | + opposite); |
---|
2640 | 2833 | break; |
---|
2641 | 2834 | |
---|
2642 | 2835 | case 2: // '\002' |
---|
.. | .. |
---|
2649 | 2842 | { |
---|
2650 | 2843 | //sel.hitSomething = childToDrag.hitSomething; |
---|
2651 | 2844 | //childToDrag.doEditDrag(info); |
---|
2652 | | - sel.doEditDrag(info, opposite); |
---|
| 2845 | + sel.doEditDrag(//clickInfo, |
---|
| 2846 | + opposite); |
---|
2653 | 2847 | } else |
---|
2654 | 2848 | { |
---|
2655 | 2849 | //super. |
---|
2656 | | - doEditDrag0(info, opposite); |
---|
| 2850 | + doEditDrag0(//clickInfo, |
---|
| 2851 | + opposite); |
---|
2657 | 2852 | } |
---|
2658 | 2853 | } |
---|
2659 | 2854 | break; |
---|
.. | .. |
---|
2671 | 2866 | { |
---|
2672 | 2867 | deselectAll(); |
---|
2673 | 2868 | } |
---|
| 2869 | + |
---|
| 2870 | + new Exception().printStackTrace(); |
---|
| 2871 | + |
---|
2674 | 2872 | ClickInfo newInfo = new ClickInfo(); |
---|
2675 | 2873 | newInfo.flags = info.flags; |
---|
2676 | 2874 | newInfo.bounds = info.bounds; |
---|
.. | .. |
---|
3100 | 3298 | { |
---|
3101 | 3299 | if (bRep != null) |
---|
3102 | 3300 | { |
---|
| 3301 | + //bRep.GenerateNormals2(crease); // in-place doesn't work. it gives wrong normals (diamond artifact). |
---|
3103 | 3302 | bRep.GenerateNormals(crease); |
---|
| 3303 | + if (!bRep.trimmed) |
---|
| 3304 | + bRep.MergeNormals(); |
---|
3104 | 3305 | Touch(); |
---|
3105 | 3306 | } |
---|
3106 | 3307 | } |
---|
.. | .. |
---|
3175 | 3376 | blockloop = false; |
---|
3176 | 3377 | } |
---|
3177 | 3378 | |
---|
| 3379 | + public void ResetTransform(int mask) |
---|
| 3380 | + { |
---|
| 3381 | + Object3D obj = this; |
---|
| 3382 | + |
---|
| 3383 | + if (mask == -1) |
---|
| 3384 | + { |
---|
| 3385 | + if (obj instanceof Camera) // jan 2014 |
---|
| 3386 | + { |
---|
| 3387 | + LA.matIdentity(obj.toParent); |
---|
| 3388 | + LA.matIdentity(obj.fromParent); |
---|
| 3389 | + } |
---|
| 3390 | + else |
---|
| 3391 | + { |
---|
| 3392 | + obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
| 3393 | + obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
| 3394 | + } |
---|
| 3395 | + return; |
---|
| 3396 | + } |
---|
| 3397 | + |
---|
| 3398 | + if ((mask&2) != 0) // Scale/rotation |
---|
| 3399 | + { |
---|
| 3400 | + obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
| 3401 | + obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
| 3402 | + obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
| 3403 | + obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
| 3404 | + obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
| 3405 | + obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
| 3406 | + } |
---|
| 3407 | + if ((mask&1) != 0) // Translation |
---|
| 3408 | + { |
---|
| 3409 | + if (obj.toParent != null) |
---|
| 3410 | + { |
---|
| 3411 | + obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
| 3412 | + obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
| 3413 | + } |
---|
| 3414 | + } |
---|
| 3415 | + } |
---|
| 3416 | + |
---|
| 3417 | + public void Scale(int scale) |
---|
| 3418 | + { |
---|
| 3419 | + Object3D obj = this; |
---|
| 3420 | + |
---|
| 3421 | + obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = scale; |
---|
| 3422 | + obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
| 3423 | + obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
| 3424 | + obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1/scale; |
---|
| 3425 | + obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
| 3426 | + obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
| 3427 | + } |
---|
| 3428 | + |
---|
| 3429 | + public void TextureRatioTransform(int axis) |
---|
| 3430 | + { |
---|
| 3431 | + cTexture tex = GetTextures(); |
---|
| 3432 | + |
---|
| 3433 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3434 | + |
---|
| 3435 | + try |
---|
| 3436 | + { |
---|
| 3437 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, texres); |
---|
| 3438 | + } |
---|
| 3439 | + catch (Exception e) |
---|
| 3440 | + { |
---|
| 3441 | + System.err.println("FAIL TextureRatio: " + this); |
---|
| 3442 | + } |
---|
| 3443 | + |
---|
| 3444 | + LA.matIdentity(Object3D.mat); |
---|
| 3445 | + Object3D.mat[axis][axis] = (double)texturedata.getWidth() / texturedata.getHeight(); |
---|
| 3446 | + |
---|
| 3447 | + if (toParent == null) |
---|
| 3448 | + { |
---|
| 3449 | + toParent = LA.newMatrix(); |
---|
| 3450 | + fromParent = LA.newMatrix(); |
---|
| 3451 | + } |
---|
| 3452 | + |
---|
| 3453 | + ResetTransform(2); |
---|
| 3454 | + |
---|
| 3455 | + LA.matConcat(Object3D.mat, fromParent, fromParent); |
---|
| 3456 | + LA.matInvert(fromParent, toParent); |
---|
| 3457 | + } |
---|
| 3458 | + |
---|
| 3459 | + void TextureRatio(int axis) |
---|
| 3460 | + { |
---|
| 3461 | + if (blockloop) |
---|
| 3462 | + return; |
---|
| 3463 | + |
---|
| 3464 | + blockloop = true; |
---|
| 3465 | + |
---|
| 3466 | + TextureRatioTransform(axis); |
---|
| 3467 | + |
---|
| 3468 | + for (int i=Size(); --i>=0;) |
---|
| 3469 | + { |
---|
| 3470 | + Object3D v = get(i); |
---|
| 3471 | + |
---|
| 3472 | + v.TextureRatio(axis); |
---|
| 3473 | + } |
---|
| 3474 | + |
---|
| 3475 | + blockloop = false; |
---|
| 3476 | + } |
---|
| 3477 | + |
---|
3178 | 3478 | void TransformChildren() |
---|
3179 | 3479 | { |
---|
3180 | 3480 | if (toParent != null) |
---|
.. | .. |
---|
3417 | 3717 | if (bRep != null) |
---|
3418 | 3718 | { |
---|
3419 | 3719 | //bRep.RemoveOneTriangle(); |
---|
| 3720 | + System.out.println(); |
---|
3420 | 3721 | System.out.println("Reducing " + this); |
---|
3421 | 3722 | if (name != null && name.contains("lockpickstraps")) |
---|
3422 | 3723 | name = name; |
---|
.. | .. |
---|
3528 | 3829 | |
---|
3529 | 3830 | void ClearMaterials() |
---|
3530 | 3831 | { |
---|
| 3832 | + if (blockloop) |
---|
| 3833 | + return; |
---|
| 3834 | + |
---|
| 3835 | + blockloop = true; |
---|
| 3836 | + |
---|
3531 | 3837 | ClearMaterial(); |
---|
3532 | | - for (int i = 0; i < size(); i++) |
---|
| 3838 | + for (int i = 0; i < Size(); i++) |
---|
3533 | 3839 | { |
---|
3534 | | - Object3D child = (Object3D) reserve(i); |
---|
| 3840 | + Object3D child = (Object3D) get(i); |
---|
3535 | 3841 | if (child == null) |
---|
3536 | 3842 | continue; |
---|
3537 | 3843 | child.ClearMaterials(); |
---|
3538 | | - release(i); |
---|
3539 | 3844 | } |
---|
| 3845 | + |
---|
| 3846 | + blockloop = false; |
---|
| 3847 | + } |
---|
| 3848 | + |
---|
| 3849 | + void ClearVersionList() |
---|
| 3850 | + { |
---|
| 3851 | + this.versionlist = null; |
---|
| 3852 | + this.versionindex = -1; |
---|
| 3853 | + this.versiontable = null; |
---|
| 3854 | + } |
---|
| 3855 | + |
---|
| 3856 | + void ClearVersions() |
---|
| 3857 | + { |
---|
| 3858 | + if (blockloop) |
---|
| 3859 | + return; |
---|
| 3860 | + |
---|
| 3861 | + blockloop = true; |
---|
| 3862 | + |
---|
| 3863 | + ClearVersionList(); |
---|
| 3864 | + for (int i = 0; i < Size(); i++) |
---|
| 3865 | + { |
---|
| 3866 | + Object3D child = (Object3D) get(i); |
---|
| 3867 | + if (child == null) |
---|
| 3868 | + continue; |
---|
| 3869 | + child.ClearVersions(); |
---|
| 3870 | + } |
---|
| 3871 | + |
---|
| 3872 | + blockloop = false; |
---|
3540 | 3873 | } |
---|
3541 | 3874 | |
---|
3542 | 3875 | void FlipV(boolean flip) |
---|
.. | .. |
---|
3715 | 4048 | |
---|
3716 | 4049 | void RevertMeshes() |
---|
3717 | 4050 | { |
---|
| 4051 | + // BLOCKLOOP |
---|
3718 | 4052 | if (this instanceof cMesh) |
---|
3719 | 4053 | { |
---|
3720 | 4054 | ((cMesh)this).Revert(); |
---|
.. | .. |
---|
3745 | 4079 | Touch(); |
---|
3746 | 4080 | } |
---|
3747 | 4081 | |
---|
3748 | | - ResetRecur(); |
---|
3749 | | - } |
---|
3750 | | - |
---|
3751 | | - void ResetRecur() |
---|
3752 | | - { |
---|
3753 | 4082 | for (int i = 0; i < size(); i++) |
---|
3754 | 4083 | { |
---|
3755 | 4084 | Object3D child = (Object3D) get(i); // reserve(i); |
---|
.. | .. |
---|
3963 | 4292 | Touch(); |
---|
3964 | 4293 | } |
---|
3965 | 4294 | |
---|
3966 | | - transient cVector min = new cVector(); |
---|
3967 | | - transient cVector max = new cVector(); |
---|
| 4295 | + transient cVector min; |
---|
| 4296 | + transient cVector max; |
---|
3968 | 4297 | |
---|
3969 | 4298 | void getBounds(cVector minima, cVector maxima, boolean xform) |
---|
3970 | 4299 | { |
---|
.. | .. |
---|
3980 | 4309 | if (blockloop) |
---|
3981 | 4310 | return; |
---|
3982 | 4311 | |
---|
3983 | | - if (min == null) // ??? |
---|
| 4312 | + if (min == null) |
---|
3984 | 4313 | { |
---|
3985 | 4314 | min = new cVector(); |
---|
3986 | 4315 | max = new cVector(); |
---|
3987 | 4316 | } |
---|
3988 | 4317 | |
---|
3989 | | - for (int i = 0; i<size(); i++) |
---|
| 4318 | + for (int i = 0; i<Size(); i++) |
---|
3990 | 4319 | { |
---|
3991 | | - Object3D child = (Object3D) reserve(i); |
---|
| 4320 | + Object3D child = (Object3D) get(i); //reserve(i); |
---|
3992 | 4321 | if (child == null) |
---|
3993 | 4322 | continue; |
---|
3994 | 4323 | |
---|
.. | .. |
---|
4007 | 4336 | if (child.hide && !(child instanceof Merge) || child.skip) |
---|
4008 | 4337 | //if (child.hide) |
---|
4009 | 4338 | { |
---|
4010 | | - release(i); |
---|
| 4339 | + //release(i); |
---|
4011 | 4340 | continue; |
---|
4012 | 4341 | } |
---|
4013 | 4342 | |
---|
4014 | 4343 | blockloop = true; |
---|
4015 | 4344 | child.getBounds(min, max, true); // xform); |
---|
4016 | 4345 | blockloop = false; |
---|
4017 | | - release(i); |
---|
| 4346 | + //release(i); |
---|
4018 | 4347 | |
---|
4019 | 4348 | MinMax(minima, maxima); |
---|
4020 | 4349 | } |
---|
4021 | 4350 | |
---|
4022 | 4351 | if (bRep != null) |
---|
4023 | 4352 | { |
---|
4024 | | - bRep.getBounds(minima,maxima,this); |
---|
| 4353 | + bRep.getBounds(minima, maxima, xform?this:null); |
---|
4025 | 4354 | } |
---|
4026 | 4355 | |
---|
4027 | 4356 | if (false) // xform) |
---|
.. | .. |
---|
5526 | 5855 | if (fullname == null) |
---|
5527 | 5856 | return ""; |
---|
5528 | 5857 | |
---|
| 5858 | + if (fullname.pigment != null) |
---|
| 5859 | + { |
---|
| 5860 | + return fullname.pigment; |
---|
| 5861 | + } |
---|
| 5862 | + |
---|
5529 | 5863 | // System.out.println("Fullname = " + fullname); |
---|
5530 | 5864 | |
---|
5531 | 5865 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5538 | 5872 | |
---|
5539 | 5873 | if (split.length == 0) |
---|
5540 | 5874 | { |
---|
5541 | | - return ""; |
---|
| 5875 | + return fullname.pigment = ""; |
---|
5542 | 5876 | } |
---|
5543 | 5877 | |
---|
5544 | 5878 | if (split.length <= 2) |
---|
.. | .. |
---|
5546 | 5880 | if (fullname.name.endsWith(":")) |
---|
5547 | 5881 | { |
---|
5548 | 5882 | // Windows |
---|
5549 | | - return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5883 | + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); |
---|
5550 | 5884 | } |
---|
5551 | 5885 | |
---|
5552 | | - return split[0]; |
---|
| 5886 | + return fullname.pigment = split[0]; |
---|
5553 | 5887 | } |
---|
5554 | 5888 | |
---|
5555 | 5889 | // Windows |
---|
5556 | 5890 | assert(split.length == 4); |
---|
5557 | 5891 | |
---|
5558 | | - return split[0] + ":" + split[1]; |
---|
| 5892 | + return fullname.pigment = split[0] + ":" + split[1]; |
---|
5559 | 5893 | } |
---|
5560 | 5894 | |
---|
5561 | 5895 | static String GetBump(cTexture fullname) |
---|
5562 | 5896 | { |
---|
5563 | 5897 | if (fullname == null) |
---|
5564 | 5898 | return ""; |
---|
| 5899 | + |
---|
| 5900 | + if (fullname.bump != null) |
---|
| 5901 | + { |
---|
| 5902 | + return fullname.bump; |
---|
| 5903 | + } |
---|
5565 | 5904 | |
---|
5566 | 5905 | // System.out.println("Fullname = " + fullname); |
---|
5567 | 5906 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5573 | 5912 | |
---|
5574 | 5913 | if (split.length == 0) |
---|
5575 | 5914 | { |
---|
5576 | | - return ""; |
---|
| 5915 | + return fullname.bump = ""; |
---|
5577 | 5916 | } |
---|
5578 | 5917 | |
---|
5579 | 5918 | if (split.length == 1) |
---|
5580 | 5919 | { |
---|
5581 | | - return ""; |
---|
| 5920 | + return fullname.bump = ""; |
---|
5582 | 5921 | } |
---|
5583 | 5922 | |
---|
5584 | 5923 | if (split.length == 2) |
---|
.. | .. |
---|
5586 | 5925 | if (fullname.name.endsWith(":")) |
---|
5587 | 5926 | { |
---|
5588 | 5927 | // Windows |
---|
5589 | | - return ""; |
---|
| 5928 | + return fullname.bump = ""; |
---|
5590 | 5929 | } |
---|
5591 | 5930 | |
---|
5592 | | - return split[1]; |
---|
| 5931 | + return fullname.bump = split[1]; |
---|
5593 | 5932 | } |
---|
5594 | 5933 | |
---|
5595 | 5934 | // Windows |
---|
5596 | 5935 | assert(split.length == 4); |
---|
5597 | 5936 | |
---|
5598 | | - return split[2] + ":" + split[3]; |
---|
| 5937 | + return fullname.bump = split[2] + ":" + split[3]; |
---|
5599 | 5938 | } |
---|
5600 | 5939 | |
---|
5601 | 5940 | String GetPigmentTexture() |
---|
.. | .. |
---|
5678 | 6017 | texname = ""; |
---|
5679 | 6018 | |
---|
5680 | 6019 | GetTextures().name = texname + ":" + GetBump(GetTextures()); |
---|
| 6020 | + |
---|
| 6021 | + GetTextures().pigment = null; |
---|
| 6022 | + |
---|
5681 | 6023 | Touch(); |
---|
5682 | 6024 | } |
---|
5683 | 6025 | |
---|
.. | .. |
---|
5751 | 6093 | |
---|
5752 | 6094 | GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; |
---|
5753 | 6095 | |
---|
| 6096 | + GetTextures().bump = null; |
---|
| 6097 | + |
---|
5754 | 6098 | Touch(); |
---|
5755 | 6099 | } |
---|
5756 | 6100 | |
---|
.. | .. |
---|
5775 | 6119 | } |
---|
5776 | 6120 | } |
---|
5777 | 6121 | |
---|
5778 | | - void EmbedTextures() |
---|
| 6122 | + void EmbedTextures(boolean embed) |
---|
5779 | 6123 | { |
---|
5780 | 6124 | if (blockloop) |
---|
5781 | 6125 | return; |
---|
5782 | 6126 | |
---|
5783 | | - CameraPane.EmbedTextures(texture); |
---|
| 6127 | + //if (GetTextures() != null) |
---|
| 6128 | + if (embed) |
---|
| 6129 | + CameraPane.EmbedTextures(GetTextures()); |
---|
| 6130 | + else |
---|
| 6131 | + { |
---|
| 6132 | + GetTextures().pigmentdata = null; |
---|
| 6133 | + GetTextures().bumpdata = null; |
---|
| 6134 | + GetTextures().pw = 0; |
---|
| 6135 | + GetTextures().ph = 0; |
---|
| 6136 | + GetTextures().bw = 0; |
---|
| 6137 | + GetTextures().bh = 0; |
---|
| 6138 | + } |
---|
5784 | 6139 | |
---|
5785 | 6140 | int nb = Size(); |
---|
5786 | 6141 | for (int i = 0; i < nb; i++) |
---|
.. | .. |
---|
5791 | 6146 | continue; |
---|
5792 | 6147 | |
---|
5793 | 6148 | blockloop = true; |
---|
5794 | | - child.EmbedTextures(); |
---|
| 6149 | + child.EmbedTextures(embed); |
---|
5795 | 6150 | blockloop = false; |
---|
5796 | 6151 | } |
---|
5797 | 6152 | } |
---|
.. | .. |
---|
5820 | 6175 | return false; |
---|
5821 | 6176 | |
---|
5822 | 6177 | return parent.IsLive(); |
---|
| 6178 | + } |
---|
| 6179 | + |
---|
| 6180 | + boolean IsDynamic() |
---|
| 6181 | + { |
---|
| 6182 | + return live && bRep != null; |
---|
5823 | 6183 | } |
---|
5824 | 6184 | |
---|
5825 | 6185 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
.. | .. |
---|
5882 | 6242 | if (support != null) |
---|
5883 | 6243 | support = support; |
---|
5884 | 6244 | |
---|
5885 | | - //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5886 | | - boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 6245 | + boolean usecalllists = !IsDynamic() && |
---|
| 6246 | + IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 6247 | + //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 6248 | + |
---|
| 6249 | + //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass. |
---|
5887 | 6250 | |
---|
5888 | 6251 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5889 | 6252 | { |
---|
.. | .. |
---|
5893 | 6256 | // usecalllists &= !(parent instanceof RandomNode); |
---|
5894 | 6257 | // usecalllists = false; |
---|
5895 | 6258 | |
---|
5896 | | - if (GetBRep() != null) |
---|
5897 | | - usecalllists = usecalllists; |
---|
| 6259 | + if (display.DrawMode() == display.SHADOW) |
---|
| 6260 | + //GetBRep() != null) |
---|
| 6261 | + usecalllists = !!usecalllists; |
---|
5898 | 6262 | //System.out.println("draw " + this); |
---|
5899 | 6263 | //new Exception().printStackTrace(); |
---|
5900 | 6264 | |
---|
.. | .. |
---|
5916 | 6280 | if (!(this instanceof Composite)) |
---|
5917 | 6281 | touched = false; |
---|
5918 | 6282 | //if (displaylist == -1 && usecalllists) |
---|
5919 | | - if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013 |
---|
| 6283 | + if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013 |
---|
5920 | 6284 | { |
---|
5921 | 6285 | bRep.displaylist = display.GenList(); |
---|
5922 | 6286 | assert(bRep.displaylist != 0); |
---|
.. | .. |
---|
5927 | 6291 | |
---|
5928 | 6292 | //System.out.println("\tnew list " + list); |
---|
5929 | 6293 | //gl.glDrawBuffer(gl.GL_NONE); |
---|
5930 | | - if (usecalllists) |
---|
| 6294 | + if (usecalllists && bRep.displaylist > 0) |
---|
5931 | 6295 | { |
---|
5932 | 6296 | // System.err.println("new list " + bRep.displaylist + " for " + this); |
---|
5933 | 6297 | display.NewList(bRep.displaylist); |
---|
.. | .. |
---|
5936 | 6300 | CallList(display, root, selected, blocked); |
---|
5937 | 6301 | |
---|
5938 | 6302 | // compiled = true; |
---|
5939 | | - if (usecalllists) |
---|
| 6303 | + if (usecalllists && bRep.displaylist > 0) |
---|
5940 | 6304 | { |
---|
5941 | 6305 | // System.err.println("end list " + bRep.displaylist + " for " + this); |
---|
5942 | 6306 | display.EndList(); |
---|
.. | .. |
---|
5946 | 6310 | Globals.lighttouched = true; // all panes... |
---|
5947 | 6311 | } |
---|
5948 | 6312 | |
---|
5949 | | - touched = GetBRep() == null; // this instanceof Composite || this instanceof FileObject; // false; |
---|
5950 | | - //touched = false; |
---|
| 6313 | + //touched = GetBRep() == null; // this instanceof Composite || this instanceof FileObject; // false; |
---|
| 6314 | + touched = false; |
---|
5951 | 6315 | |
---|
5952 | 6316 | if (this instanceof Texture || this instanceof TextureNode) |
---|
5953 | 6317 | { |
---|
.. | .. |
---|
6048 | 6412 | { |
---|
6049 | 6413 | drawSelf(display, root, selected, blocked); |
---|
6050 | 6414 | } |
---|
| 6415 | + |
---|
| 6416 | +// if (!(this instanceof Composite)) |
---|
| 6417 | +// { |
---|
| 6418 | +// for (int i = 0; i < size(); i++) |
---|
| 6419 | +// { |
---|
| 6420 | +// Object3D child = (Object3D) reserve(i); |
---|
| 6421 | +// if (child == null) |
---|
| 6422 | +// continue; |
---|
| 6423 | +// |
---|
| 6424 | +// child.draw(display, root, selected, blocked); |
---|
| 6425 | +// |
---|
| 6426 | +// release(i); |
---|
| 6427 | +// } |
---|
| 6428 | +// } |
---|
6051 | 6429 | } else |
---|
6052 | 6430 | { |
---|
6053 | 6431 | /* |
---|
.. | .. |
---|
6080 | 6458 | boolean failedPigment = false; |
---|
6081 | 6459 | boolean failedBump = false; |
---|
6082 | 6460 | |
---|
| 6461 | + CameraPane.lastObject = this; |
---|
6083 | 6462 | try |
---|
6084 | 6463 | { |
---|
6085 | 6464 | display.BindPigmentTexture(tex, texres); |
---|
6086 | 6465 | } |
---|
6087 | 6466 | catch (Exception e) |
---|
6088 | 6467 | { |
---|
6089 | | - System.err.println("FAILED: " + this); |
---|
| 6468 | + // System.err.println("FAILED: " + this); |
---|
6090 | 6469 | failedPigment = true; |
---|
6091 | 6470 | } |
---|
6092 | 6471 | |
---|
.. | .. |
---|
6117 | 6496 | display.CallList(bRep.displaylist); |
---|
6118 | 6497 | // june 2013 drawSelf(display, root, selected); |
---|
6119 | 6498 | } |
---|
| 6499 | + } |
---|
| 6500 | + |
---|
| 6501 | + assert (!(this instanceof Composite)); |
---|
| 6502 | + { |
---|
| 6503 | +// CRASH MOCAP!! for (int i = 0; i < size(); i++) |
---|
| 6504 | +// { |
---|
| 6505 | +// Object3D child = (Object3D) reserve(i); |
---|
| 6506 | +// if (child == null) |
---|
| 6507 | +// continue; |
---|
| 6508 | +// |
---|
| 6509 | +// child.draw(display, root, selected, blocked); |
---|
| 6510 | +// |
---|
| 6511 | +// release(i); |
---|
| 6512 | +// } |
---|
6120 | 6513 | } |
---|
6121 | 6514 | } |
---|
6122 | 6515 | |
---|
.. | .. |
---|
6170 | 6563 | |
---|
6171 | 6564 | void CallList(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
6172 | 6565 | { |
---|
6173 | | - if (GetBRep() == null) |
---|
6174 | | - { |
---|
6175 | | - drawSelf(display, root, selected, blocked); |
---|
6176 | | - } else |
---|
| 6566 | + if (GetBRep() != null) |
---|
6177 | 6567 | { |
---|
6178 | 6568 | DrawNode(display, root, selected); |
---|
6179 | 6569 | if (this instanceof BezierPatch) |
---|
6180 | 6570 | { |
---|
6181 | 6571 | //drawSelf(display, root, selected); |
---|
6182 | 6572 | } |
---|
| 6573 | + } |
---|
| 6574 | + else |
---|
| 6575 | + { |
---|
| 6576 | + drawSelf(display, root, selected, blocked); |
---|
6183 | 6577 | } |
---|
6184 | 6578 | } |
---|
6185 | 6579 | |
---|
.. | .. |
---|
7287 | 7681 | } |
---|
7288 | 7682 | } |
---|
7289 | 7683 | |
---|
7290 | | - protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec) |
---|
| 7684 | + static ClickInfo clickInfo = new ClickInfo(); |
---|
| 7685 | + |
---|
| 7686 | + protected void calcHotSpot(cVector in, //ClickInfo clickInfo, |
---|
| 7687 | + Point outPt, Rectangle outRec) |
---|
7291 | 7688 | { |
---|
7292 | | - int hc = info.bounds.x + info.bounds.width / 2; |
---|
7293 | | - int vc = info.bounds.y + info.bounds.height / 2; |
---|
7294 | | - double[][] toscreen = info.toScreen; |
---|
| 7689 | + int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2; |
---|
| 7690 | + int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2; |
---|
| 7691 | + double[][] toscreen = clickInfo.toScreen; |
---|
7295 | 7692 | if (toscreen == null) |
---|
7296 | 7693 | { |
---|
7297 | | - toscreen = new Camera(info.camera.viewCode).toScreen; |
---|
| 7694 | + toscreen = new Camera(clickInfo.camera.viewCode).toScreen; |
---|
7298 | 7695 | } |
---|
7299 | 7696 | cVector vec = in; |
---|
7300 | 7697 | LA.xformPos(in, toscreen, in); |
---|
7301 | 7698 | //System.out.println("Distance = " + info.camera.Distance()); |
---|
7302 | | - vec.x *= 100 * info.camera.SCALE / info.camera.Distance(); |
---|
7303 | | - vec.y *= 100 * info.camera.SCALE / info.camera.Distance(); |
---|
| 7699 | + vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance(); |
---|
| 7700 | + vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance(); |
---|
7304 | 7701 | outPt.x = hc + (int) vec.x; |
---|
7305 | 7702 | outPt.y = vc - (int) vec.y; |
---|
7306 | 7703 | outRec.x = outPt.x - 3; |
---|
.. | .. |
---|
7308 | 7705 | outRec.width = outRec.height = 6; |
---|
7309 | 7706 | } |
---|
7310 | 7707 | |
---|
7311 | | - protected Rectangle calcHotSpot(cVector in, ClickInfo info) |
---|
| 7708 | + protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo |
---|
| 7709 | + ) |
---|
7312 | 7710 | { |
---|
7313 | 7711 | Point pt = new Point(0, 0); |
---|
7314 | 7712 | Rectangle rec = new Rectangle(); |
---|
7315 | | - calcHotSpot(in, info, pt, rec); |
---|
| 7713 | + calcHotSpot(in, //clickInfo, |
---|
| 7714 | + pt, rec); |
---|
7316 | 7715 | return rec; |
---|
7317 | 7716 | } |
---|
7318 | 7717 | |
---|
7319 | | - void drawEditHandles0(ClickInfo info, int level) |
---|
| 7718 | + void drawEditHandles0(//ClickInfo clickInfo, |
---|
| 7719 | + int level) |
---|
7320 | 7720 | { |
---|
7321 | 7721 | if (level == 0) |
---|
7322 | 7722 | { |
---|
.. | .. |
---|
7325 | 7725 | { |
---|
7326 | 7726 | cVector origin = new cVector(); |
---|
7327 | 7727 | //LA.xformPos(origin, toParent, origin); |
---|
7328 | | - Rectangle spot = calcHotSpot(origin, info); |
---|
| 7728 | + if (this.clickInfo == null) |
---|
| 7729 | + this.clickInfo = new ClickInfo(); |
---|
| 7730 | + |
---|
| 7731 | + Rectangle spot = calcHotSpot(origin); //, clickInfo); |
---|
7329 | 7732 | Rectangle boundary = new Rectangle(); |
---|
7330 | 7733 | boundary.x = spot.x - 30; |
---|
7331 | 7734 | boundary.y = spot.y - 30; |
---|
7332 | 7735 | boundary.width = spot.width + 60; |
---|
7333 | 7736 | boundary.height = spot.height + 60; |
---|
7334 | | - info.g.setColor(Color.red); |
---|
| 7737 | + clickInfo.g.setColor(Color.white); |
---|
7335 | 7738 | int spotw = spot.x + spot.width; |
---|
7336 | 7739 | int spoth = spot.y + spot.height; |
---|
7337 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7740 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7338 | 7741 | // if (CameraPane.Xmin > spot.x) |
---|
7339 | 7742 | // { |
---|
7340 | 7743 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7351 | 7754 | // { |
---|
7352 | 7755 | // CameraPane.Ymax = spoth; |
---|
7353 | 7756 | // } |
---|
7354 | | - spot.translate(32, 32); |
---|
7355 | | - spotw = spot.x + spot.width; |
---|
7356 | | - spoth = spot.y + spot.height; |
---|
7357 | | - info.g.setColor(Color.cyan); |
---|
7358 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7359 | 7757 | // if (CameraPane.Xmin > spot.x) |
---|
7360 | 7758 | // { |
---|
7361 | 7759 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7374 | 7772 | // } |
---|
7375 | 7773 | // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7376 | 7774 | //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7377 | | - spot.translate(0, -32); |
---|
7378 | | - info.g.setColor(Color.yellow); |
---|
7379 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7380 | | - info.g.setColor(Color.green); |
---|
| 7775 | + spot.translate(32, 0); |
---|
| 7776 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7777 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7778 | + |
---|
| 7779 | + spot.translate(32, 64); |
---|
| 7780 | + spotw = spot.x + spot.width; |
---|
| 7781 | + spoth = spot.y + spot.height; |
---|
| 7782 | + clickInfo.g.setColor(Color.cyan); |
---|
| 7783 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7381 | 7784 | // if (CameraPane.Xmin > spot.x) |
---|
7382 | 7785 | // { |
---|
7383 | 7786 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7394 | 7797 | // { |
---|
7395 | 7798 | // CameraPane.Ymax = spoth; |
---|
7396 | 7799 | // } |
---|
7397 | | - info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
7398 | | - (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
| 7800 | + clickInfo.g.setColor(Color.green); |
---|
| 7801 | + clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
| 7802 | + (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7399 | 7803 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7400 | 7804 | // if (CameraPane.Xmin > boundary.x) |
---|
7401 | 7805 | // { |
---|
.. | .. |
---|
7417 | 7821 | } |
---|
7418 | 7822 | } |
---|
7419 | 7823 | |
---|
7420 | | - boolean doEditClick0(ClickInfo info, int level) |
---|
| 7824 | + boolean doEditClick0(//ClickInfo clickInfo, |
---|
| 7825 | + int level) |
---|
7421 | 7826 | { |
---|
7422 | 7827 | if (level == 0) |
---|
7423 | 7828 | { |
---|
.. | .. |
---|
7426 | 7831 | |
---|
7427 | 7832 | boolean retval = false; |
---|
7428 | 7833 | |
---|
7429 | | - startX = info.x; |
---|
7430 | | - startY = info.y; |
---|
| 7834 | + startX = clickInfo.x; |
---|
| 7835 | + startY = clickInfo.y; |
---|
7431 | 7836 | |
---|
7432 | 7837 | hitSomething = -1; |
---|
7433 | 7838 | cVector origin = new cVector(); |
---|
.. | .. |
---|
7437 | 7842 | { |
---|
7438 | 7843 | centerPt = new Point(0, 0); |
---|
7439 | 7844 | } |
---|
7440 | | - calcHotSpot(origin, info, centerPt, spot); |
---|
7441 | | - if (spot.contains(info.x, info.y)) |
---|
| 7845 | + calcHotSpot(origin, //info, |
---|
| 7846 | + centerPt, spot); |
---|
| 7847 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7442 | 7848 | { |
---|
7443 | 7849 | hitSomething = hitCenter; |
---|
7444 | 7850 | retval = true; |
---|
7445 | 7851 | } |
---|
7446 | 7852 | spot.translate(32, 0); |
---|
7447 | | - if (spot.contains(info.x, info.y)) |
---|
| 7853 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7448 | 7854 | { |
---|
7449 | 7855 | hitSomething = hitRotate; |
---|
7450 | 7856 | retval = true; |
---|
7451 | 7857 | } |
---|
7452 | 7858 | spot.translate(0, 32); |
---|
7453 | | - if (spot.contains(info.x, info.y)) |
---|
| 7859 | + spot.translate(32, 0); |
---|
| 7860 | + spot.translate(0, 32); |
---|
| 7861 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7454 | 7862 | { |
---|
7455 | 7863 | hitSomething = hitScale; |
---|
| 7864 | + |
---|
| 7865 | + double scale = 0.005f * clickInfo.camera.Distance(); |
---|
| 7866 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
| 7867 | + double sign = 1; |
---|
| 7868 | + if (hScale < 0) |
---|
| 7869 | + { |
---|
| 7870 | + sign = -1; |
---|
| 7871 | + } |
---|
| 7872 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
| 7873 | + if (hScale < 0.01) |
---|
| 7874 | + { |
---|
| 7875 | + //hScale = 0.01; |
---|
| 7876 | + } |
---|
| 7877 | + |
---|
| 7878 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
| 7879 | + sign = 1; |
---|
| 7880 | + if (vScale < 0) |
---|
| 7881 | + { |
---|
| 7882 | + sign = -1; |
---|
| 7883 | + } |
---|
| 7884 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
| 7885 | + if (vScale < 0.01) |
---|
| 7886 | + { |
---|
| 7887 | + //vScale = 0.01; |
---|
| 7888 | + } |
---|
| 7889 | + |
---|
| 7890 | + clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale); |
---|
| 7891 | + |
---|
7456 | 7892 | retval = true; |
---|
7457 | 7893 | } |
---|
7458 | 7894 | |
---|
.. | .. |
---|
7462 | 7898 | } |
---|
7463 | 7899 | |
---|
7464 | 7900 | //System.out.println("info.modifiers = " + info.modifiers); |
---|
7465 | | - modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
| 7901 | + modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
7466 | 7902 | //System.out.println("modified = " + modified); |
---|
7467 | 7903 | //new Exception().printStackTrace(); |
---|
7468 | 7904 | //viewCode = info.pane.renderCamera.viewCode; |
---|
.. | .. |
---|
7490 | 7926 | return true; |
---|
7491 | 7927 | } |
---|
7492 | 7928 | |
---|
7493 | | - void doEditDrag0(ClickInfo info, boolean opposite) |
---|
| 7929 | + void doEditDrag0(//ClickInfo info, |
---|
| 7930 | + boolean opposite) |
---|
7494 | 7931 | { |
---|
7495 | 7932 | if (hitSomething == 0) |
---|
7496 | 7933 | { |
---|
.. | .. |
---|
7504 | 7941 | |
---|
7505 | 7942 | //System.out.println("hitSomething = " + hitSomething); |
---|
7506 | 7943 | |
---|
7507 | | - double scale = 0.005f * info.camera.Distance(); |
---|
| 7944 | + double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7508 | 7945 | |
---|
7509 | 7946 | cVector xlate = new cVector(); |
---|
7510 | 7947 | //cVector xlate2 = new cVector(); |
---|
.. | .. |
---|
7518 | 7955 | |
---|
7519 | 7956 | scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance(); |
---|
7520 | 7957 | |
---|
7521 | | - if (modified || opposite) |
---|
| 7958 | + // Modified could snap |
---|
| 7959 | + if (//modified || |
---|
| 7960 | + opposite) |
---|
7522 | 7961 | { |
---|
7523 | 7962 | //assert(false); |
---|
7524 | 7963 | /* |
---|
.. | .. |
---|
7538 | 7977 | toParent[3][i] = xlate.get(i); |
---|
7539 | 7978 | LA.matInvert(toParent, fromParent); |
---|
7540 | 7979 | */ |
---|
7541 | | - cVector delta = LA.newVector(0, 0, startY - info.y); |
---|
7542 | | - LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta); |
---|
| 7980 | + cVector delta = LA.newVector(0, 0, startY - clickInfo.y); |
---|
| 7981 | + LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta); |
---|
7543 | 7982 | |
---|
7544 | 7983 | LA.matCopy(startMat, toParent); |
---|
7545 | 7984 | LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale); |
---|
.. | .. |
---|
7548 | 7987 | } else |
---|
7549 | 7988 | { |
---|
7550 | 7989 | //LA.xformDir(delta, info.camera.fromScreen, delta); |
---|
7551 | | - cVector up = new cVector(info.camera.up); |
---|
| 7990 | + cVector up = new cVector(clickInfo.camera.up); |
---|
7552 | 7991 | cVector away = new cVector(); |
---|
7553 | 7992 | //cVector right2 = new cVector(); |
---|
7554 | 7993 | //LA.vecCross(up, cVector.Z, right); |
---|
.. | .. |
---|
7565 | 8004 | LA.xformDir(up, ClickInfo.matbuffer, up); |
---|
7566 | 8005 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7567 | 8006 | LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up); |
---|
7568 | | - LA.xformDir(info.camera.away, ClickInfo.matbuffer, away); |
---|
| 8007 | + LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away); |
---|
7569 | 8008 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7570 | 8009 | LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away); |
---|
7571 | 8010 | //LA.vecCross(up, cVector.Z, right2); |
---|
7572 | 8011 | |
---|
7573 | | - cVector delta = LA.newVector(info.x - startX, startY - info.y, 0); |
---|
| 8012 | + cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0); |
---|
7574 | 8013 | |
---|
7575 | 8014 | //System.out.println("DELTA0 = " + delta); |
---|
7576 | 8015 | //System.out.println("AWAY = " + info.camera.away); |
---|
7577 | 8016 | //System.out.println("UP = " + info.camera.up); |
---|
7578 | 8017 | if (away.z > 0) |
---|
7579 | 8018 | { |
---|
7580 | | - if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0) |
---|
| 8019 | + if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0) |
---|
7581 | 8020 | { |
---|
7582 | 8021 | delta.x = -delta.x; |
---|
7583 | 8022 | } else |
---|
.. | .. |
---|
7592 | 8031 | //System.out.println("DELTA1 = " + delta); |
---|
7593 | 8032 | LA.xformDir(delta, ClickInfo.matbuffer, delta); |
---|
7594 | 8033 | //System.out.println("DELTA2 = " + delta); |
---|
7595 | | - LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta); |
---|
| 8034 | + LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta); |
---|
7596 | 8035 | LA.matCopy(startMat, toParent); |
---|
7597 | 8036 | //System.out.println("DELTA3 = " + delta); |
---|
7598 | 8037 | LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale); |
---|
.. | .. |
---|
7602 | 8041 | break; |
---|
7603 | 8042 | |
---|
7604 | 8043 | case hitRotate: // rotate |
---|
7605 | | - int dx = info.x - centerPt.x; |
---|
7606 | | - int dy = -(info.y - centerPt.y); |
---|
| 8044 | + int dx = clickInfo.x - centerPt.x; |
---|
| 8045 | + int dy = -(clickInfo.y - centerPt.y); |
---|
7607 | 8046 | double angle = (double) Math.atan2(dx, dy); |
---|
7608 | 8047 | angle = -(1.570796 - angle); |
---|
7609 | 8048 | |
---|
.. | .. |
---|
7612 | 8051 | |
---|
7613 | 8052 | if (modified) |
---|
7614 | 8053 | { |
---|
7615 | | - // Rotate 90 degrees |
---|
| 8054 | + // Rotate 45 degrees |
---|
7616 | 8055 | angle /= (Math.PI / 4); |
---|
7617 | 8056 | angle = Math.floor(angle + 0.5); |
---|
7618 | 8057 | angle *= (Math.PI / 4); |
---|
.. | .. |
---|
7626 | 8065 | } |
---|
7627 | 8066 | /**/ |
---|
7628 | 8067 | |
---|
7629 | | - switch (info.pane.RenderCamera().viewCode) |
---|
| 8068 | + switch (clickInfo.pane.RenderCamera().viewCode) |
---|
7630 | 8069 | { |
---|
7631 | 8070 | case 1: // '\001' |
---|
7632 | 8071 | LA.matZRotate(toParent, angle); |
---|
.. | .. |
---|
7653 | 8092 | break; |
---|
7654 | 8093 | |
---|
7655 | 8094 | case hitScale: // scale |
---|
7656 | | - double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 8095 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7657 | 8096 | double sign = 1; |
---|
7658 | 8097 | if (hScale < 0) |
---|
7659 | 8098 | { |
---|
.. | .. |
---|
7665 | 8104 | //hScale = 0.01; |
---|
7666 | 8105 | } |
---|
7667 | 8106 | |
---|
7668 | | - double vScale = (double) (info.y - centerPt.y) / 32; |
---|
| 8107 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7669 | 8108 | sign = 1; |
---|
7670 | 8109 | if (vScale < 0) |
---|
7671 | 8110 | { |
---|
.. | .. |
---|
7676 | 8115 | { |
---|
7677 | 8116 | //vScale = 0.01; |
---|
7678 | 8117 | } |
---|
| 8118 | + |
---|
7679 | 8119 | LA.matCopy(startMat, toParent); |
---|
7680 | 8120 | /**/ |
---|
7681 | 8121 | for (int i = 0; i < 3; i++) |
---|
.. | .. |
---|
7685 | 8125 | } |
---|
7686 | 8126 | /**/ |
---|
7687 | 8127 | |
---|
7688 | | - double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 8128 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale; |
---|
7689 | 8129 | |
---|
7690 | 8130 | if (totalScale < 0.01) |
---|
7691 | 8131 | { |
---|
7692 | 8132 | totalScale = 0.01; |
---|
7693 | 8133 | } |
---|
7694 | 8134 | |
---|
7695 | | - switch (info.pane.RenderCamera().viewCode) |
---|
| 8135 | + switch (clickInfo.pane.RenderCamera().viewCode) |
---|
7696 | 8136 | { |
---|
7697 | 8137 | case 3: // '\001' |
---|
7698 | 8138 | if (modified || opposite) |
---|
7699 | 8139 | { |
---|
| 8140 | + if (modified) // && opposite) |
---|
| 8141 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 8142 | + else |
---|
7700 | 8143 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7701 | | - LA.matScale(toParent, totalScale, 1, 1); |
---|
| 8144 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7702 | 8145 | } // vScale, 1); |
---|
7703 | 8146 | else |
---|
7704 | 8147 | { |
---|
7705 | 8148 | // EXCEPTION! |
---|
7706 | | - LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 8149 | + LA.matScale(toParent, 1, totalScale, totalScale); |
---|
7707 | 8150 | } // vScale, 1); |
---|
7708 | 8151 | break; |
---|
7709 | 8152 | |
---|
7710 | 8153 | case 2: // '\002' |
---|
7711 | 8154 | if (modified || opposite) |
---|
7712 | 8155 | { |
---|
7713 | | - //LA.matScale(toParent, hScale, 1, vScale); |
---|
7714 | | - LA.matScale(toParent, 1, totalScale, 1); |
---|
| 8156 | + if (modified) // && opposite) |
---|
| 8157 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 8158 | + else |
---|
| 8159 | + //LA.matScale(toParent, hScale, 1, vScale); |
---|
| 8160 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7715 | 8161 | } else |
---|
7716 | 8162 | { |
---|
7717 | 8163 | LA.matScale(toParent, totalScale, 1, totalScale); |
---|
.. | .. |
---|
7721 | 8167 | case 1: // '\003' |
---|
7722 | 8168 | if (modified || opposite) |
---|
7723 | 8169 | { |
---|
7724 | | - //LA.matScale(toParent, hScale, vScale, 1); |
---|
7725 | | - LA.matScale(toParent, 1, 1, totalScale); |
---|
| 8170 | + if (modified) // && opposite) |
---|
| 8171 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 8172 | + else |
---|
| 8173 | + //LA.matScale(toParent, hScale, vScale, 1); |
---|
| 8174 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7726 | 8175 | } else |
---|
7727 | 8176 | { |
---|
7728 | 8177 | LA.matScale(toParent, totalScale, totalScale, 1); |
---|
.. | .. |
---|
7759 | 8208 | } // NEW ... |
---|
7760 | 8209 | |
---|
7761 | 8210 | |
---|
7762 | | - info.pane.repaint(); |
---|
| 8211 | + clickInfo.pane.repaint(); |
---|
7763 | 8212 | } |
---|
7764 | 8213 | |
---|
7765 | 8214 | boolean overflow = false; |
---|
.. | .. |
---|
7873 | 8322 | if (!Globals.ADVANCED) |
---|
7874 | 8323 | return objname; |
---|
7875 | 8324 | |
---|
7876 | | - return objname + " " + System.identityHashCode(this); |
---|
| 8325 | + return objname + " " + System.identityHashCode(this) + " " + GetUUID(); |
---|
7877 | 8326 | } |
---|
7878 | 8327 | |
---|
7879 | 8328 | public int hashCode() |
---|
.. | .. |
---|
8118 | 8567 | private static cVector2 qq2 = new cVector2(); |
---|
8119 | 8568 | private static cVector2 rr2 = new cVector2(); |
---|
8120 | 8569 | private static cVector2 ss2 = new cVector2(); |
---|
8121 | | - private static cVector edge1 = new cVector(); |
---|
8122 | | - private static cVector edge2 = new cVector(); |
---|
| 8570 | +// private static cVector edge1 = new cVector(); |
---|
| 8571 | +// private static cVector edge2 = new cVector(); |
---|
8123 | 8572 | //private static cVector norm = new cVector(); |
---|
8124 | 8573 | /*transient private*/ int hitSomething; |
---|
8125 | 8574 | static final int hitCenter = 1; |
---|
.. | .. |
---|
8317 | 8766 | |
---|
8318 | 8767 | Touch(); |
---|
8319 | 8768 | } |
---|
| 8769 | + |
---|
| 8770 | + static Vertex s1 = new Vertex(); |
---|
| 8771 | + static Vertex s2 = new Vertex(); |
---|
| 8772 | + static Vertex s3 = new Vertex(); |
---|
8320 | 8773 | |
---|
| 8774 | + boolean intersectMesh(Ray ray, IntersectResult result) |
---|
| 8775 | + { |
---|
| 8776 | + boolean success = false; |
---|
| 8777 | + |
---|
| 8778 | + if (bRep.stripified) |
---|
| 8779 | + { |
---|
| 8780 | + int[] strips = bRep.getRawIndices(); |
---|
| 8781 | + |
---|
| 8782 | + // TRIANGLE STRIP ARRAY |
---|
| 8783 | + if (bRep.trimmed) |
---|
| 8784 | + { |
---|
| 8785 | + float[] v = bRep.getRawVertices(); |
---|
| 8786 | + |
---|
| 8787 | + int count3 = 0; |
---|
| 8788 | + |
---|
| 8789 | + if (v.length > 0) |
---|
| 8790 | + { |
---|
| 8791 | + for (int i = 0; i < strips.length; i++) |
---|
| 8792 | + { |
---|
| 8793 | + s1.set(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
| 8794 | + count3 += 3; |
---|
| 8795 | + |
---|
| 8796 | + s2.set(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
| 8797 | + count3 += 3; |
---|
| 8798 | + |
---|
| 8799 | + for (int j = 0; j < strips[i] - 2; j++) |
---|
| 8800 | + { |
---|
| 8801 | + s3.set(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
| 8802 | + count3 += 3; |
---|
| 8803 | + |
---|
| 8804 | + if (j%2 == 0) |
---|
| 8805 | + success |= intersectTriangle(ray, result, s1, s2, s3); |
---|
| 8806 | + else |
---|
| 8807 | + success |= intersectTriangle(ray, result, s1, s3, s2); |
---|
| 8808 | + |
---|
| 8809 | + s1.set(s2); |
---|
| 8810 | + s2.set(s3); |
---|
| 8811 | + } |
---|
| 8812 | + } |
---|
| 8813 | + } |
---|
| 8814 | + |
---|
| 8815 | + assert count3 == v.length; |
---|
| 8816 | + } |
---|
| 8817 | + else // !trimmed |
---|
| 8818 | + { |
---|
| 8819 | + int count = 0; |
---|
| 8820 | + for (int i = 0; i < strips.length; i++) |
---|
| 8821 | + { |
---|
| 8822 | + Vertex p = bRep.GetVertex(bRep.indices[count++]); |
---|
| 8823 | + Vertex q = bRep.GetVertex(bRep.indices[count++]); |
---|
| 8824 | + |
---|
| 8825 | + for (int j = 0; j < strips[i] - 2; j++) |
---|
| 8826 | + { |
---|
| 8827 | + Vertex r = bRep.GetVertex(bRep.indices[count++]); |
---|
| 8828 | + |
---|
| 8829 | + if (j%2 == 0) |
---|
| 8830 | + success |= intersectTriangle(ray, result, p, q, r); |
---|
| 8831 | + else |
---|
| 8832 | + success |= intersectTriangle(ray, result, p, r, q); |
---|
| 8833 | + |
---|
| 8834 | + p = q; |
---|
| 8835 | + q = r; |
---|
| 8836 | + } |
---|
| 8837 | + } |
---|
| 8838 | + } |
---|
| 8839 | + } else // catch (Error e) |
---|
| 8840 | + { |
---|
| 8841 | + int facecount = bRep.FaceCount(); |
---|
| 8842 | + for (int i = 0; i < facecount; i++) |
---|
| 8843 | + { |
---|
| 8844 | + Face face = bRep.GetFace(i); |
---|
| 8845 | + |
---|
| 8846 | + Vertex p = bRep.GetVertex(face.p); |
---|
| 8847 | + Vertex q = bRep.GetVertex(face.q); |
---|
| 8848 | + Vertex r = bRep.GetVertex(face.r); |
---|
| 8849 | + |
---|
| 8850 | + success |= intersectTriangle(ray, result, p, q, r); |
---|
| 8851 | + } |
---|
| 8852 | + } |
---|
| 8853 | + |
---|
| 8854 | + return success; |
---|
| 8855 | + } |
---|
| 8856 | + |
---|
| 8857 | + static cVector eye = new cVector(); |
---|
| 8858 | + static cVector dir = new cVector(); |
---|
| 8859 | + |
---|
| 8860 | + transient BBox bbox = null; |
---|
| 8861 | + |
---|
| 8862 | + boolean intersect(Ray ray, IntersectResult result) |
---|
| 8863 | + { |
---|
| 8864 | + double eyex = ray.eyePoint.x; |
---|
| 8865 | + double eyey = ray.eyePoint.y; |
---|
| 8866 | + double eyez = ray.eyePoint.z; |
---|
| 8867 | + |
---|
| 8868 | + double dirx = ray.viewDirection.x; |
---|
| 8869 | + double diry = ray.viewDirection.y; |
---|
| 8870 | + double dirz = ray.viewDirection.z; |
---|
| 8871 | + |
---|
| 8872 | + if (this.fromParent != null) |
---|
| 8873 | + { |
---|
| 8874 | + eye.x = eyex; |
---|
| 8875 | + eye.y = eyey; |
---|
| 8876 | + eye.z = eyez; |
---|
| 8877 | + dir.x = dirx; |
---|
| 8878 | + dir.y = diry; |
---|
| 8879 | + dir.z = dirz; |
---|
| 8880 | + |
---|
| 8881 | + LA.xformPos(eye, this.fromParent, eye); |
---|
| 8882 | + LA.xformDir(dir, this.fromParent, dir); |
---|
| 8883 | + |
---|
| 8884 | + ray.eyePoint.x = eye.x; |
---|
| 8885 | + ray.eyePoint.y = eye.y; |
---|
| 8886 | + ray.eyePoint.z = eye.z; |
---|
| 8887 | + |
---|
| 8888 | + ray.viewDirection.x = dir.x; |
---|
| 8889 | + ray.viewDirection.y = dir.y; |
---|
| 8890 | + ray.viewDirection.z = dir.z; |
---|
| 8891 | + } |
---|
| 8892 | + |
---|
| 8893 | + boolean success = false; |
---|
| 8894 | + |
---|
| 8895 | + boolean touch = false; |
---|
| 8896 | + |
---|
| 8897 | + if (bRep != null) |
---|
| 8898 | + { |
---|
| 8899 | + if (bbox == null) |
---|
| 8900 | + { |
---|
| 8901 | + bbox = new BBox(); |
---|
| 8902 | + |
---|
| 8903 | + cVector min = new cVector(); |
---|
| 8904 | + cVector max = new cVector(); |
---|
| 8905 | + |
---|
| 8906 | + this.getBounds(min, max, false); |
---|
| 8907 | + |
---|
| 8908 | + bbox.min.x = min.x; |
---|
| 8909 | + bbox.min.y = min.y; |
---|
| 8910 | + bbox.min.z = min.z; |
---|
| 8911 | + |
---|
| 8912 | + bbox.max.x = max.x; |
---|
| 8913 | + bbox.max.y = max.y; |
---|
| 8914 | + bbox.max.z = max.z; |
---|
| 8915 | + } |
---|
| 8916 | + |
---|
| 8917 | + if (bbox.intersect(ray, result)) |
---|
| 8918 | + { |
---|
| 8919 | + success |= intersectMesh(ray, result); |
---|
| 8920 | + } |
---|
| 8921 | + else |
---|
| 8922 | + { |
---|
| 8923 | + //this.hide = true; |
---|
| 8924 | + touch = true; |
---|
| 8925 | + } |
---|
| 8926 | + } |
---|
| 8927 | + |
---|
| 8928 | + for (int i=0; i<size(); i++) |
---|
| 8929 | + { |
---|
| 8930 | + Object3D child = (Object3D) reserve(i); |
---|
| 8931 | + |
---|
| 8932 | + if (child == null) |
---|
| 8933 | + continue; |
---|
| 8934 | + |
---|
| 8935 | + success |= child.intersect(ray, result); |
---|
| 8936 | + release(i); |
---|
| 8937 | + } |
---|
| 8938 | + |
---|
| 8939 | + ray.eyePoint.x = eyex; |
---|
| 8940 | + ray.eyePoint.y = eyey; |
---|
| 8941 | + ray.eyePoint.z = eyez; |
---|
| 8942 | + |
---|
| 8943 | + ray.viewDirection.x = dirx; |
---|
| 8944 | + ray.viewDirection.y = diry; |
---|
| 8945 | + ray.viewDirection.z = dirz; |
---|
| 8946 | + |
---|
| 8947 | +// if (touch) |
---|
| 8948 | +// this.Touch(); // refresh display list |
---|
| 8949 | + |
---|
| 8950 | + return success; |
---|
| 8951 | + } |
---|
| 8952 | + |
---|
| 8953 | + static Vector3d edge1 = new Vector3d(); |
---|
| 8954 | + static Vector3d edge2 = new Vector3d(); |
---|
| 8955 | + static Vector3d P = new Vector3d(); |
---|
| 8956 | + static Vector3d T = new Vector3d(); |
---|
| 8957 | + static Vector3d Q = new Vector3d(); |
---|
| 8958 | + |
---|
| 8959 | + private boolean intersectTriangle(Ray ray, IntersectResult result, Vertex v1, Vertex v2, Vertex v3) |
---|
| 8960 | + { |
---|
| 8961 | + /* |
---|
| 8962 | + Fast, Minimum Storage Ray/Triangle Intersection, Moller et al. |
---|
| 8963 | + |
---|
| 8964 | + Reference: http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf |
---|
| 8965 | + */ |
---|
| 8966 | + |
---|
| 8967 | + // Calculate edges of the triangle |
---|
| 8968 | + edge1.set(v2.x - v1.x, v2.y - v1.y, v2.z - v1.z); |
---|
| 8969 | + edge2.set(v3.x - v1.x, v3.y - v1.y, v3.z - v1.z); |
---|
| 8970 | + |
---|
| 8971 | + // Calculate the determinant (U parameter) |
---|
| 8972 | + P.cross(ray.viewDirection, edge2); |
---|
| 8973 | + double det = edge1.dot(P); |
---|
| 8974 | + |
---|
| 8975 | + if (det > -1e-9 && det < 1e-9) |
---|
| 8976 | + { |
---|
| 8977 | + return false; |
---|
| 8978 | + } // Ray lies in plane of triangle |
---|
| 8979 | + |
---|
| 8980 | + double invDet = 1 / det; |
---|
| 8981 | + |
---|
| 8982 | + // Calculate distance from vertex1 to ray origin |
---|
| 8983 | + T.set(ray.eyePoint.x - v1.x, ray.eyePoint.y - v1.y, ray.eyePoint.z - v1.z); |
---|
| 8984 | + |
---|
| 8985 | + double U = (T.dot(P)) * invDet; // Calculate U parameter |
---|
| 8986 | + |
---|
| 8987 | + if (U < 0.f || U > 1.f) |
---|
| 8988 | + { |
---|
| 8989 | + return false; |
---|
| 8990 | + } // Intersection lies outside of the triangle |
---|
| 8991 | + |
---|
| 8992 | + // Calculate V parameter |
---|
| 8993 | + Q.cross(T, edge1); |
---|
| 8994 | + |
---|
| 8995 | + double V = ray.viewDirection.dot(Q) * invDet; |
---|
| 8996 | + |
---|
| 8997 | + if (V < 0.f || (U + V) > 1.f) |
---|
| 8998 | + { |
---|
| 8999 | + return false; |
---|
| 9000 | + } // Intersection lies outside of the triangle |
---|
| 9001 | + |
---|
| 9002 | + double t = edge2.dot(Q) * invDet; |
---|
| 9003 | + |
---|
| 9004 | + if (t > 1e-9) // Triangle and ray intersects |
---|
| 9005 | + { |
---|
| 9006 | + //result.isIntersected = true; |
---|
| 9007 | + //result.id = id; |
---|
| 9008 | + |
---|
| 9009 | + if (false) // isShadow) |
---|
| 9010 | + { |
---|
| 9011 | + result.t = t; |
---|
| 9012 | + return true; |
---|
| 9013 | + } else if (t < result.t) |
---|
| 9014 | + { |
---|
| 9015 | + result.object = this; |
---|
| 9016 | + |
---|
| 9017 | + result.t = t; |
---|
| 9018 | + |
---|
| 9019 | + //result.p.x = ray.eyePoint.x + ray.viewDirection.x * t; |
---|
| 9020 | + //result.p.y = ray.eyePoint.y + ray.viewDirection.y * t; |
---|
| 9021 | + //result.p.z = ray.eyePoint.z + ray.viewDirection.z * t; |
---|
| 9022 | + |
---|
| 9023 | + result.n.cross(edge1, edge2); |
---|
| 9024 | + result.n.normalize(); |
---|
| 9025 | + } |
---|
| 9026 | + |
---|
| 9027 | + return true; |
---|
| 9028 | + } |
---|
| 9029 | + |
---|
| 9030 | + return false; |
---|
| 9031 | + } |
---|
8321 | 9032 | |
---|
8322 | 9033 | public int Size() |
---|
8323 | 9034 | { |
---|