.. | .. |
---|
2065 | 2065 | //System.err.println("Oeil on"); |
---|
2066 | 2066 | OEIL = true; |
---|
2067 | 2067 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
2068 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 2068 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
2069 | 2069 | //pingthread.StepToTarget(true); |
---|
2070 | 2070 | } |
---|
2071 | 2071 | |
---|
.. | .. |
---|
2298 | 2298 | HANDLES ^= true; |
---|
2299 | 2299 | } |
---|
2300 | 2300 | |
---|
| 2301 | + Object3D paintFolder; |
---|
| 2302 | + |
---|
2301 | 2303 | void TogglePaint() |
---|
2302 | 2304 | { |
---|
2303 | 2305 | PAINTMODE ^= true; |
---|
2304 | 2306 | paintcount = 0; |
---|
| 2307 | + |
---|
| 2308 | + if (PAINTMODE) |
---|
| 2309 | + { |
---|
| 2310 | + paintFolder = GetFolder(); |
---|
| 2311 | + } |
---|
2305 | 2312 | } |
---|
2306 | 2313 | |
---|
2307 | 2314 | void SwapCamera(int a, int b) |
---|
.. | .. |
---|
2396 | 2403 | public GL GetGL() // INTERFACE |
---|
2397 | 2404 | { |
---|
2398 | 2405 | return currentGL; |
---|
2399 | | - } |
---|
2400 | | - |
---|
2401 | | - private void GetRemoteZip(String url, String name, boolean unzip, boolean save) |
---|
2402 | | - { |
---|
2403 | | - java.net.URL u; |
---|
2404 | | - InputStream is = null; |
---|
2405 | | - DataInputStream dis; |
---|
2406 | | - java.util.zip.ZipInputStream zis; |
---|
2407 | | - //String s; |
---|
2408 | | - |
---|
2409 | | - System.out.println("GetRemoteZip " + name); |
---|
2410 | | - |
---|
2411 | | - int total = 0; // dis.available(); |
---|
2412 | | - |
---|
2413 | | - byte[] bytes = new byte[16384]; |
---|
2414 | | - |
---|
2415 | | - try |
---|
2416 | | - { |
---|
2417 | | - u = new java.net.URL(url + name); |
---|
2418 | | - is = u.openStream(); |
---|
2419 | | - |
---|
2420 | | - System.out.println(url + name); |
---|
2421 | | - |
---|
2422 | | - if (unzip) |
---|
2423 | | - { |
---|
2424 | | - //dis = new DataInputStream(new BufferedInputStream(is)); |
---|
2425 | | - zis = new java.util.zip.ZipInputStream(new BufferedInputStream(is)); |
---|
2426 | | - //while ((s = dis.readLine()) != null) |
---|
2427 | | - |
---|
2428 | | - if (save) |
---|
2429 | | - new java.io.File(name).mkdirs(); |
---|
2430 | | - |
---|
2431 | | - // FileOutputStream stream = new FileOutputStream("test.zip"); |
---|
2432 | | - // |
---|
2433 | | - // int count; |
---|
2434 | | - // |
---|
2435 | | - // while ((count = dis.read(bytes)) != -1) |
---|
2436 | | - // { |
---|
2437 | | - // //System.out.println(s); |
---|
2438 | | - // System.out.println(count); |
---|
2439 | | - // total += count; |
---|
2440 | | - // stream.write(bytes); |
---|
2441 | | - // } |
---|
2442 | | - // |
---|
2443 | | - // stream.close(); |
---|
2444 | | - |
---|
2445 | | - // now iterate through each item in the stream. The get next |
---|
2446 | | - // entry call will return a ZipEntry for each file in the |
---|
2447 | | - // stream |
---|
2448 | | - java.util.zip.ZipEntry entry; |
---|
2449 | | - while((entry = zis.getNextEntry())!=null) |
---|
2450 | | - { |
---|
2451 | | - if (entry.getName().endsWith(".gsm")) |
---|
2452 | | - { |
---|
2453 | | - continue; |
---|
2454 | | - } |
---|
2455 | | - |
---|
2456 | | - String s = String.format("Entry: %s len %d added %TD", |
---|
2457 | | - entry.getName(), entry.getSize(), |
---|
2458 | | - new java.util.Date(entry.getTime())); |
---|
2459 | | - System.out.println(s); |
---|
2460 | | - |
---|
2461 | | - if (save) |
---|
2462 | | - { |
---|
2463 | | - // Once we get the entry from the stream, the stream is |
---|
2464 | | - // positioned read to read the raw data, and we keep |
---|
2465 | | - // reading until read returns 0 or less. |
---|
2466 | | - String outpath = name + "/" + entry.getName(); |
---|
2467 | | - FileOutputStream output = null; |
---|
2468 | | - try |
---|
2469 | | - { |
---|
2470 | | - output = new FileOutputStream(outpath); |
---|
2471 | | - int len = 0; |
---|
2472 | | - while ((len = zis.read(bytes)) > 0) |
---|
2473 | | - { |
---|
2474 | | - output.write(bytes, 0, len); |
---|
2475 | | - } |
---|
2476 | | - } |
---|
2477 | | - finally |
---|
2478 | | - { |
---|
2479 | | - // we must always close the output file |
---|
2480 | | - if(output!=null) output.close(); |
---|
2481 | | - } |
---|
2482 | | - } |
---|
2483 | | - } |
---|
2484 | | - } |
---|
2485 | | - } |
---|
2486 | | - catch (java.net.MalformedURLException mue) |
---|
2487 | | - { |
---|
2488 | | - System.err.println("Ouch - a MalformedURLException happened."); |
---|
2489 | | - mue.printStackTrace(); |
---|
2490 | | - //System.exit(2); |
---|
2491 | | - } |
---|
2492 | | - catch (IOException ioe) |
---|
2493 | | - { |
---|
2494 | | - //System.err.println("Oops - an IOException happened."); |
---|
2495 | | - //ioe.printStackTrace(); |
---|
2496 | | - //System.exit(3); |
---|
2497 | | - } |
---|
2498 | | - finally |
---|
2499 | | - { |
---|
2500 | | - try |
---|
2501 | | - { |
---|
2502 | | - if (is != null) |
---|
2503 | | - is.close(); |
---|
2504 | | - } |
---|
2505 | | - catch (IOException ioe) |
---|
2506 | | - { |
---|
2507 | | - } |
---|
2508 | | - } |
---|
2509 | | - |
---|
2510 | | - // System.out.println("length = " + total); |
---|
2511 | | - |
---|
2512 | | -// try |
---|
2513 | | -// { |
---|
2514 | | -// Runtime.getRuntime().exec("/usr/local/bin/wget https://archive3d.net/?a=download&do=get&id=7caca905"); |
---|
2515 | | -// } |
---|
2516 | | -// catch (Exception e) |
---|
2517 | | -// { |
---|
2518 | | -// e.printStackTrace(); |
---|
2519 | | -// } |
---|
2520 | | - |
---|
2521 | 2406 | } |
---|
2522 | 2407 | |
---|
2523 | 2408 | /**/ |
---|
.. | .. |
---|
8045 | 7930 | String pigment = Object3D.GetPigment(tex); |
---|
8046 | 7931 | String bump = Object3D.GetBump(tex); |
---|
8047 | 7932 | |
---|
8048 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7933 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8049 | 7934 | { |
---|
8050 | 7935 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
8051 | 7936 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8079 | 7964 | |
---|
8080 | 7965 | String pigment = Object3D.GetPigment(tex); |
---|
8081 | 7966 | |
---|
8082 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7967 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8083 | 7968 | { |
---|
8084 | 7969 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
8085 | 7970 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8108 | 7993 | |
---|
8109 | 7994 | String bump = Object3D.GetBump(tex); |
---|
8110 | 7995 | |
---|
8111 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7996 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8112 | 7997 | { |
---|
8113 | 7998 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
8114 | 7999 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8246 | 8131 | usedtextures.put(pigment, pigment); |
---|
8247 | 8132 | usedtextures.put(bump, bump); |
---|
8248 | 8133 | |
---|
8249 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8134 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8250 | 8135 | { |
---|
8251 | 8136 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8252 | 8137 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8288 | 8173 | |
---|
8289 | 8174 | usedtextures.put(pigment, pigment); |
---|
8290 | 8175 | |
---|
8291 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8176 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8292 | 8177 | { |
---|
8293 | 8178 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8294 | 8179 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8321 | 8206 | |
---|
8322 | 8207 | usedtextures.put(bump, bump); |
---|
8323 | 8208 | |
---|
8324 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8209 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8325 | 8210 | { |
---|
8326 | 8211 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8327 | 8212 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8632 | 8517 | return false; |
---|
8633 | 8518 | } |
---|
8634 | 8519 | |
---|
8635 | | - boolean newtex = false; |
---|
| 8520 | + //boolean newtex = false; |
---|
8636 | 8521 | |
---|
8637 | 8522 | com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution); |
---|
8638 | 8523 | |
---|
.. | .. |
---|
8664 | 8549 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_S, GetGL().GL_REPEAT); |
---|
8665 | 8550 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_T, GetGL().GL_REPEAT); |
---|
8666 | 8551 | |
---|
8667 | | - return newtex; |
---|
| 8552 | + return true; // Warning: not used. |
---|
8668 | 8553 | } |
---|
8669 | 8554 | |
---|
8670 | 8555 | ShadowBuffer shadowPBuf; |
---|
.. | .. |
---|
11150 | 11035 | |
---|
11151 | 11036 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
11152 | 11037 | |
---|
11153 | | -//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
11154 | | -//gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
11155 | | -//gl.glEnable(gl.GL_MULTISAMPLE); |
---|
| 11038 | +gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
| 11039 | +gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
| 11040 | +gl.glEnable(gl.GL_MULTISAMPLE); |
---|
11156 | 11041 | } else |
---|
11157 | 11042 | { |
---|
11158 | 11043 | //gl.glDisable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11163 | 11048 | //System.out.println("BLENDING ON"); |
---|
11164 | 11049 | gl.glEnable(GL.GL_BLEND); |
---|
11165 | 11050 | gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); |
---|
11166 | | - |
---|
| 11051 | +// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE); |
---|
11167 | 11052 | gl.glMatrixMode(gl.GL_PROJECTION); |
---|
11168 | 11053 | gl.glLoadIdentity(); |
---|
11169 | 11054 | |
---|
.. | .. |
---|
11649 | 11534 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
11650 | 11535 | { |
---|
11651 | 11536 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
11652 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 11537 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
11653 | 11538 | pingthread.StepToTarget(true); // true); |
---|
11654 | 11539 | // zoomonce = false; |
---|
11655 | 11540 | } |
---|
.. | .. |
---|
14065 | 13950 | |
---|
14066 | 13951 | // fev 2014??? |
---|
14067 | 13952 | if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
14068 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 13953 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
14069 | 13954 | pingthread.StepToTarget(true); // true); |
---|
14070 | 13955 | } |
---|
14071 | 13956 | // if (!LIVE) |
---|
.. | .. |
---|
14419 | 14304 | void GoDown(int mod) |
---|
14420 | 14305 | { |
---|
14421 | 14306 | MODIFIERS |= COMMAND; |
---|
14422 | | - /* |
---|
| 14307 | + /**/ |
---|
14423 | 14308 | if((mod&SHIFT) == SHIFT) |
---|
14424 | 14309 | manipCamera.RotatePosition(0, -speed); |
---|
14425 | 14310 | else |
---|
14426 | | - manipCamera.BackForth(0, -speed*delta, getWidth()); |
---|
14427 | | - */ |
---|
| 14311 | + manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14312 | + /**/ |
---|
14428 | 14313 | if ((mod & SHIFT) == SHIFT) |
---|
14429 | 14314 | { |
---|
14430 | 14315 | mouseMode = mouseMode; // VR?? |
---|
.. | .. |
---|
14440 | 14325 | void GoUp(int mod) |
---|
14441 | 14326 | { |
---|
14442 | 14327 | MODIFIERS |= COMMAND; |
---|
14443 | | - /* |
---|
| 14328 | + /**/ |
---|
14444 | 14329 | if((mod&SHIFT) == SHIFT) |
---|
14445 | 14330 | manipCamera.RotatePosition(0, speed); |
---|
14446 | 14331 | else |
---|
14447 | | - manipCamera.BackForth(0, speed*delta, getWidth()); |
---|
14448 | | - */ |
---|
| 14332 | + manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14333 | + /**/ |
---|
14449 | 14334 | if ((mod & SHIFT) == SHIFT) |
---|
14450 | 14335 | { |
---|
14451 | 14336 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14461 | 14346 | void GoLeft(int mod) |
---|
14462 | 14347 | { |
---|
14463 | 14348 | MODIFIERS |= COMMAND; |
---|
14464 | | - /* |
---|
| 14349 | + /**/ |
---|
14465 | 14350 | if((mod&SHIFT) == SHIFT) |
---|
14466 | | - manipCamera.RotatePosition(speed, 0); |
---|
14467 | | - else |
---|
14468 | 14351 | manipCamera.Translate(speed*delta, 0, getWidth()); |
---|
14469 | | - */ |
---|
| 14352 | + else |
---|
| 14353 | + manipCamera.RotatePosition(speed, 0); |
---|
| 14354 | + /**/ |
---|
14470 | 14355 | if ((mod & SHIFT) == SHIFT) |
---|
14471 | 14356 | { |
---|
14472 | 14357 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14482 | 14367 | void GoRight(int mod) |
---|
14483 | 14368 | { |
---|
14484 | 14369 | MODIFIERS |= COMMAND; |
---|
14485 | | - /* |
---|
| 14370 | + /**/ |
---|
14486 | 14371 | if((mod&SHIFT) == SHIFT) |
---|
14487 | | - manipCamera.RotatePosition(-speed, 0); |
---|
14488 | | - else |
---|
14489 | 14372 | manipCamera.Translate(-speed*delta, 0, getWidth()); |
---|
14490 | | - */ |
---|
| 14373 | + else |
---|
| 14374 | + manipCamera.RotatePosition(-speed, 0); |
---|
| 14375 | + /**/ |
---|
14491 | 14376 | if ((mod & SHIFT) == SHIFT) |
---|
14492 | 14377 | { |
---|
14493 | 14378 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14726 | 14611 | Globals.MOUSEDRAGGED = false; |
---|
14727 | 14612 | |
---|
14728 | 14613 | movingcamera = false; |
---|
14729 | | - X = Y = 0; |
---|
| 14614 | + X = 0; // getBounds().width/2; |
---|
| 14615 | + Y = 0; // getBounds().height/2; |
---|
14730 | 14616 | //System.out.println("mouseReleased: " + e); |
---|
14731 | 14617 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14732 | 14618 | } |
---|
.. | .. |
---|
15067 | 14953 | case 'E' : COMPACT ^= true; |
---|
15068 | 14954 | repaint(); |
---|
15069 | 14955 | break; |
---|
15070 | | - case 'W' : DEBUGHSB ^= true; |
---|
| 14956 | + case 'W' : // Wide Window (fullscreen) |
---|
| 14957 | + //DEBUGHSB ^= true; |
---|
| 14958 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
15071 | 14959 | repaint(); |
---|
15072 | 14960 | break; |
---|
15073 | 14961 | case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break; |
---|
.. | .. |
---|
15093 | 14981 | repaint(); |
---|
15094 | 14982 | break; |
---|
15095 | 14983 | case 'l': |
---|
15096 | | - lightMode ^= true; |
---|
15097 | | - Globals.lighttouched = true; |
---|
15098 | | - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
15099 | | - targetLookAt.set(manipCamera.lookAt); |
---|
15100 | | - repaint(); |
---|
15101 | | - break; |
---|
15102 | | - case 'L': |
---|
| 14984 | + //case 'L': |
---|
15103 | 14985 | if (lightMode) |
---|
15104 | 14986 | { |
---|
15105 | 14987 | lightMode = false; |
---|
.. | .. |
---|
15246 | 15128 | // kompactbit = 6; |
---|
15247 | 15129 | // break; |
---|
15248 | 15130 | case ' ': |
---|
15249 | | - ObjEditor.theFrame.ToggleFullScreen(); |
---|
| 15131 | + lightMode ^= true; |
---|
| 15132 | + Globals.lighttouched = true; |
---|
| 15133 | + manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
| 15134 | + targetLookAt.set(manipCamera.lookAt); |
---|
15250 | 15135 | repaint(); |
---|
15251 | 15136 | break; |
---|
15252 | 15137 | //case '`' : |
---|
.. | .. |
---|
15295 | 15180 | break; |
---|
15296 | 15181 | case '+': |
---|
15297 | 15182 | |
---|
15298 | | - //for (int i=0; i<0x7FFFFFFF; i++) |
---|
15299 | | - { |
---|
15300 | | - //String.format("%08X", i); // "7caca905" |
---|
15301 | | - GetRemoteZip("https://archive3d.net/?a=download&do=get&id=", "7caca905", true, true); |
---|
15302 | | - } |
---|
15303 | | - |
---|
15304 | 15183 | /* |
---|
15305 | 15184 | //fontsize += 1; |
---|
15306 | 15185 | bbzoom *= 2; |
---|
.. | .. |
---|
15318 | 15197 | case '=': |
---|
15319 | 15198 | IncDepth(); |
---|
15320 | 15199 | //fontsize += 1; |
---|
15321 | | - object.editWindow.refreshContents(true); |
---|
| 15200 | + object.GetWindow().refreshContents(true); |
---|
15322 | 15201 | maskbit = 6; |
---|
15323 | 15202 | break; |
---|
15324 | 15203 | case '-': //if (PixelThreshold>1) PixelThreshold /= 2; |
---|
15325 | 15204 | DecDepth(); |
---|
15326 | 15205 | maskbit = 5; |
---|
15327 | 15206 | //if(fontsize > 1) fontsize -= 1; |
---|
15328 | | - if (object.editWindow == null) |
---|
15329 | | - new Exception().printStackTrace(); |
---|
15330 | | - else |
---|
15331 | | - object.editWindow.refreshContents(true); |
---|
| 15207 | +// if (object.editWindow == null) |
---|
| 15208 | +// new Exception().printStackTrace(); |
---|
| 15209 | +// else |
---|
| 15210 | + object.GetWindow().refreshContents(true); |
---|
15332 | 15211 | break; |
---|
15333 | 15212 | case '{': |
---|
15334 | 15213 | manipCamera.shaper_fovy /= 1.1; |
---|
.. | .. |
---|
15552 | 15431 | } |
---|
15553 | 15432 | */ |
---|
15554 | 15433 | |
---|
15555 | | - object.editWindow.EditSelection(false); |
---|
| 15434 | + object.GetWindow().EditSelection(false); |
---|
15556 | 15435 | } |
---|
15557 | 15436 | |
---|
15558 | 15437 | void SelectParent() |
---|
.. | .. |
---|
15569 | 15448 | { |
---|
15570 | 15449 | //selectees.remove(i); |
---|
15571 | 15450 | System.out.println("select parent of " + elem); |
---|
15572 | | - group.editWindow.Select(elem.parent.GetTreePath(), first, true); |
---|
| 15451 | + group.GetWindow().Select(elem.parent.GetTreePath(), first, true); |
---|
15573 | 15452 | } else |
---|
15574 | 15453 | { |
---|
15575 | | - group.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15454 | + group.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15576 | 15455 | } |
---|
15577 | 15456 | |
---|
15578 | 15457 | first = false; |
---|
.. | .. |
---|
15614 | 15493 | for (int j = 0; j < group.children.size(); j++) |
---|
15615 | 15494 | { |
---|
15616 | 15495 | elem = (Object3D) group.children.elementAt(j); |
---|
15617 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15496 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15618 | 15497 | first = false; |
---|
15619 | 15498 | } |
---|
15620 | 15499 | } else |
---|
15621 | 15500 | { |
---|
15622 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15501 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15623 | 15502 | } |
---|
15624 | 15503 | |
---|
15625 | 15504 | first = false; |
---|
.. | .. |
---|
15630 | 15509 | { |
---|
15631 | 15510 | //Composite group = (Composite) object; |
---|
15632 | 15511 | Object3D group = object; |
---|
15633 | | - group.editWindow.loadClipboard(true); // ClearSelection(false); |
---|
| 15512 | + group.GetWindow().loadClipboard(true); // ClearSelection(false); |
---|
15634 | 15513 | } |
---|
15635 | 15514 | |
---|
15636 | 15515 | void ResetTransform(int mask) |
---|
15637 | 15516 | { |
---|
15638 | 15517 | //Composite group = (Composite) object; |
---|
15639 | 15518 | Object3D group = object; |
---|
15640 | | - group.editWindow.ResetTransform(mask); |
---|
| 15519 | + group.GetWindow().ResetTransform(mask); |
---|
15641 | 15520 | } |
---|
15642 | 15521 | |
---|
15643 | 15522 | void FlipTransform() |
---|
15644 | 15523 | { |
---|
15645 | 15524 | //Composite group = (Composite) object; |
---|
15646 | 15525 | Object3D group = object; |
---|
15647 | | - group.editWindow.FlipTransform(); |
---|
| 15526 | + group.GetWindow().FlipTransform(); |
---|
15648 | 15527 | // group.editWindow.ReduceMesh(true); |
---|
15649 | 15528 | } |
---|
15650 | 15529 | |
---|
.. | .. |
---|
15652 | 15531 | { |
---|
15653 | 15532 | //Composite group = (Composite) object; |
---|
15654 | 15533 | Object3D group = object; |
---|
15655 | | - group.editWindow.PrintMemory(); |
---|
| 15534 | + group.GetWindow().PrintMemory(); |
---|
15656 | 15535 | // group.editWindow.ReduceMesh(true); |
---|
15657 | 15536 | } |
---|
15658 | 15537 | |
---|
.. | .. |
---|
15660 | 15539 | { |
---|
15661 | 15540 | //Composite group = (Composite) object; |
---|
15662 | 15541 | Object3D group = object; |
---|
15663 | | - group.editWindow.ResetCentroid(); |
---|
| 15542 | + group.GetWindow().ResetCentroid(); |
---|
15664 | 15543 | } |
---|
15665 | 15544 | |
---|
15666 | 15545 | void IncDepth() |
---|
.. | .. |
---|
15836 | 15715 | info.bounds.y += (height - desired) / 2; |
---|
15837 | 15716 | } |
---|
15838 | 15717 | } |
---|
| 15718 | + |
---|
15839 | 15719 | info.g = gr; |
---|
15840 | 15720 | info.camera = renderCamera; |
---|
15841 | 15721 | /* |
---|
.. | .. |
---|
15845 | 15725 | */ |
---|
15846 | 15726 | if (!isRenderer) |
---|
15847 | 15727 | { |
---|
15848 | | - object.drawEditHandles(info, 0); |
---|
15849 | | - |
---|
15850 | | - if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0) |
---|
| 15728 | + Grafreed.Assert(object != null); |
---|
| 15729 | + Grafreed.Assert(object.selection != null); |
---|
| 15730 | + if (object.selection.Size() > 0) |
---|
15851 | 15731 | { |
---|
15852 | | - switch (object.selection.get(0).hitSomething) |
---|
| 15732 | + int hitSomething = object.selection.get(0).hitSomething; |
---|
| 15733 | + |
---|
| 15734 | + info.DX = 0; |
---|
| 15735 | + info.DY = 0; |
---|
| 15736 | + info.W = 1; |
---|
| 15737 | + if (hitSomething == Object3D.hitCenter) |
---|
15853 | 15738 | { |
---|
15854 | | - case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
15855 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15856 | | - break; |
---|
15857 | | - case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
15858 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15859 | | - break; |
---|
15860 | | - case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
15861 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15862 | | - break; |
---|
| 15739 | + info.DX = X; |
---|
| 15740 | + if (X != 0) |
---|
| 15741 | + info.DX -= info.bounds.width/2; |
---|
| 15742 | + |
---|
| 15743 | + info.DY = Y; |
---|
| 15744 | + if (Y != 0) |
---|
| 15745 | + info.DY -= info.bounds.height/2; |
---|
15863 | 15746 | } |
---|
15864 | | - |
---|
| 15747 | + |
---|
| 15748 | + object.drawEditHandles(info, 0); |
---|
| 15749 | + |
---|
| 15750 | + if (drag && (X != 0 || Y != 0)) |
---|
| 15751 | + { |
---|
| 15752 | + switch (hitSomething) |
---|
| 15753 | + { |
---|
| 15754 | + case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
| 15755 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15756 | + break; |
---|
| 15757 | + case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
| 15758 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15759 | + break; |
---|
| 15760 | + case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
| 15761 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15762 | + break; |
---|
| 15763 | + } |
---|
| 15764 | + |
---|
| 15765 | + } |
---|
15865 | 15766 | } |
---|
15866 | 15767 | } |
---|
15867 | 15768 | } |
---|
.. | .. |
---|
16659 | 16560 | } |
---|
16660 | 16561 | } |
---|
16661 | 16562 | |
---|
| 16563 | + private Object3D GetFolder() |
---|
| 16564 | + { |
---|
| 16565 | + Object3D folder = object.GetWindow().copy; |
---|
| 16566 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16567 | + folder = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16568 | + return folder; |
---|
| 16569 | + } |
---|
| 16570 | + |
---|
16662 | 16571 | class SelectBuffer implements GLEventListener |
---|
16663 | 16572 | { |
---|
16664 | 16573 | |
---|
.. | .. |
---|
16738 | 16647 | |
---|
16739 | 16648 | //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); |
---|
16740 | 16649 | |
---|
| 16650 | + if (PAINTMODE) |
---|
| 16651 | + { |
---|
| 16652 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16653 | + { |
---|
| 16654 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16655 | + |
---|
| 16656 | + // Make what you paint not selectable. |
---|
| 16657 | + paintobj.ResetSelectable(); |
---|
| 16658 | + } |
---|
| 16659 | + } |
---|
| 16660 | + |
---|
16741 | 16661 | //int tmp = selection_view; |
---|
16742 | 16662 | //selection_view = -1; |
---|
16743 | 16663 | int temp = DrawMode(); |
---|
.. | .. |
---|
16749 | 16669 | // temp = DEFAULT; // patch for selection debug |
---|
16750 | 16670 | Globals.drawMode = temp; // WARNING |
---|
16751 | 16671 | |
---|
| 16672 | + if (PAINTMODE) |
---|
| 16673 | + { |
---|
| 16674 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16675 | + { |
---|
| 16676 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16677 | + |
---|
| 16678 | + // Revert. |
---|
| 16679 | + paintobj.RestoreSelectable(); |
---|
| 16680 | + } |
---|
| 16681 | + } |
---|
| 16682 | + |
---|
16752 | 16683 | //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view); |
---|
16753 | 16684 | |
---|
16754 | 16685 | // trying different ways of getting the depth info over |
---|
.. | .. |
---|
16852 | 16783 | } |
---|
16853 | 16784 | |
---|
16854 | 16785 | if (!movingcamera && !PAINTMODE) |
---|
16855 | | - object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
| 16786 | + object.GetWindow().ScreenFitPoint(); // fev 2014 |
---|
16856 | 16787 | |
---|
16857 | | - if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16788 | + if (PAINTMODE) // && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16858 | 16789 | { |
---|
16859 | | - Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
| 16790 | + //Object3D paintobj; // = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16860 | 16791 | |
---|
16861 | | - Object3D group = new Object3D("inst" + paintcount++); |
---|
| 16792 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16793 | + { |
---|
| 16794 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
16862 | 16795 | |
---|
16863 | | - group.CreateMaterial(); // use a void leaf to select instances |
---|
16864 | | - |
---|
16865 | | - group.add(paintobj); // link |
---|
16866 | | - |
---|
16867 | | - object.editWindow.SnapObject(group); |
---|
16868 | | - |
---|
16869 | | - Object3D folder = object.editWindow.copy; |
---|
16870 | | - |
---|
16871 | | - if (object.editWindow.copy.selection.Size() > 0) |
---|
16872 | | - folder = object.editWindow.copy.selection.elementAt(0); |
---|
16873 | | - |
---|
16874 | | - folder.add(group); |
---|
16875 | | - |
---|
16876 | | - object.editWindow.ResetModel(); |
---|
16877 | | - object.editWindow.refreshContents(); |
---|
| 16796 | + Object3D inst = new Object3D("inst" + paintcount++); |
---|
| 16797 | + |
---|
| 16798 | + inst.CreateMaterial(); // use a void leaf to select instances |
---|
| 16799 | + |
---|
| 16800 | + inst.add(paintobj); // link |
---|
| 16801 | + |
---|
| 16802 | + object.GetWindow().SnapObject(inst); |
---|
| 16803 | + |
---|
| 16804 | + Object3D folder = paintFolder; // GetFolder(); |
---|
| 16805 | + |
---|
| 16806 | + folder.add(inst); |
---|
| 16807 | + |
---|
| 16808 | + object.GetWindow().ResetModel(); |
---|
| 16809 | + object.GetWindow().refreshContents(); |
---|
| 16810 | + } |
---|
16878 | 16811 | } |
---|
16879 | 16812 | else |
---|
16880 | 16813 | paintcount = 0; |
---|