.. | .. |
---|
56 | 56 | static int CURRENTANTIALIAS = 0; // 1; |
---|
57 | 57 | /*static*/ boolean RENDERSHADOW = true; |
---|
58 | 58 | /*static*/ int RENDERPROGRAM = 2; // 0 == none, 1 == fast, 2 == normal |
---|
59 | | - static boolean ANIMATION = false; |
---|
60 | | - static String filename; |
---|
61 | 59 | |
---|
62 | 60 | boolean DISPLAYTEXT = false; |
---|
63 | 61 | //boolean REDUCETEXTURE = true; |
---|
.. | .. |
---|
92 | 90 | |
---|
93 | 91 | static int tickcount = 0; // slow pose issue |
---|
94 | 92 | |
---|
| 93 | +static boolean BUTTONLESSWHEEL = false; |
---|
| 94 | +static boolean ZOOMBOXMODE = false; |
---|
95 | 95 | static boolean BOXMODE = false; |
---|
96 | 96 | static boolean IMAGEFLIP = false; |
---|
97 | 97 | static boolean SMOOTHFOCUS = false; |
---|
.. | .. |
---|
106 | 106 | static boolean OEIL = true; |
---|
107 | 107 | static boolean OEILONCE = false; // do oeilon then oeiloff |
---|
108 | 108 | static boolean LOOKAT = true; |
---|
109 | | -static boolean RANDOM = true; // false; |
---|
| 109 | +static boolean SWITCH = true; // false; |
---|
110 | 110 | static boolean HANDLES = false; // selection doesn't work!! |
---|
111 | 111 | static boolean PAINTMODE = false; |
---|
112 | 112 | |
---|
.. | .. |
---|
223 | 223 | public boolean IsBoxMode() |
---|
224 | 224 | { |
---|
225 | 225 | return BOXMODE; |
---|
| 226 | + } |
---|
| 227 | + |
---|
| 228 | + public boolean IsZoomBoxMode() |
---|
| 229 | + { |
---|
| 230 | + return ZOOMBOXMODE; |
---|
226 | 231 | } |
---|
227 | 232 | |
---|
228 | 233 | public void ClearDepth() |
---|
.. | .. |
---|
1612 | 1617 | //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0); |
---|
1613 | 1618 | if (!material.multiply) |
---|
1614 | 1619 | { |
---|
1615 | | - display.color = color; |
---|
| 1620 | + display.color = material.color; |
---|
1616 | 1621 | display.saturation = material.modulation; |
---|
1617 | 1622 | } |
---|
1618 | 1623 | else |
---|
1619 | 1624 | { |
---|
1620 | | - display.color *= color*2; |
---|
| 1625 | + display.color *= material.color*2; |
---|
1621 | 1626 | display.saturation *= material.modulation*2; |
---|
1622 | 1627 | } |
---|
1623 | 1628 | |
---|
1624 | 1629 | cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0); |
---|
1625 | 1630 | |
---|
1626 | | - float[] colorV = GrafreeD.colorV; |
---|
| 1631 | + float[] colorV = Grafreed.colorV; |
---|
1627 | 1632 | |
---|
1628 | 1633 | /**/ |
---|
1629 | 1634 | if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0) |
---|
.. | .. |
---|
2135 | 2140 | System.err.println("LIVE = " + Globals.isLIVE()); |
---|
2136 | 2141 | |
---|
2137 | 2142 | if (!Globals.isLIVE()) // save sound |
---|
2138 | | - GrafreeD.savesound = true; // wav.save(); |
---|
| 2143 | + Grafreed.savesound = true; // wav.save(); |
---|
2139 | 2144 | // else |
---|
2140 | 2145 | repaint(); // start loop // may 2013 |
---|
2141 | 2146 | } |
---|
.. | .. |
---|
2168 | 2173 | public void ToggleBoxMode() |
---|
2169 | 2174 | { |
---|
2170 | 2175 | BOXMODE ^= true; |
---|
| 2176 | + } |
---|
| 2177 | + |
---|
| 2178 | + public void ToggleZoomBoxMode() |
---|
| 2179 | + { |
---|
| 2180 | + ZOOMBOXMODE ^= true; |
---|
2171 | 2181 | } |
---|
2172 | 2182 | |
---|
2173 | 2183 | public void ToggleSmoothFocus() |
---|
.. | .. |
---|
2257 | 2267 | |
---|
2258 | 2268 | void ToggleRandom() |
---|
2259 | 2269 | { |
---|
2260 | | - RANDOM ^= true; |
---|
| 2270 | + SWITCH ^= true; |
---|
2261 | 2271 | } |
---|
2262 | 2272 | |
---|
2263 | 2273 | void ToggleHandles() |
---|
.. | .. |
---|
4196 | 4206 | |
---|
4197 | 4207 | com.sun.opengl.util.texture.Texture CompressTexture2(String name) |
---|
4198 | 4208 | { |
---|
| 4209 | + new Exception().printStackTrace(); |
---|
4199 | 4210 | System.exit(0); |
---|
4200 | 4211 | com.sun.opengl.util.texture.Texture texture = null; |
---|
4201 | 4212 | |
---|
.. | .. |
---|
8011 | 8022 | } |
---|
8012 | 8023 | } |
---|
8013 | 8024 | |
---|
8014 | | - /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE |
---|
| 8025 | + /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
8015 | 8026 | { |
---|
8016 | 8027 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
8017 | 8028 | ambientOcclusion ) // || !textureon) |
---|
.. | .. |
---|
8056 | 8067 | return; // true; |
---|
8057 | 8068 | } |
---|
8058 | 8069 | |
---|
8059 | | - CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) |
---|
| 8070 | + CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8060 | 8071 | { |
---|
8061 | 8072 | CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
8062 | 8073 | |
---|
.. | .. |
---|
8064 | 8075 | { |
---|
8065 | 8076 | String texname = tex; |
---|
8066 | 8077 | |
---|
8067 | | - String[] split = tex.split("Textures"); |
---|
8068 | | - if (split.length > 1) |
---|
8069 | | - texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
8070 | | - else |
---|
8071 | | - if (!texname.startsWith("/")) |
---|
8072 | | - texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8078 | +// String[] split = tex.split("Textures"); |
---|
| 8079 | +// if (split.length > 1) |
---|
| 8080 | +// texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
| 8081 | +// else |
---|
| 8082 | +// if (!texname.startsWith("/")) |
---|
| 8083 | +// texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8084 | + if (!new File(tex).exists()) |
---|
| 8085 | + { |
---|
| 8086 | + texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname; |
---|
| 8087 | + } |
---|
8073 | 8088 | |
---|
8074 | 8089 | if (CACHETEXTURE) |
---|
8075 | 8090 | texture = textures.get(texname); // TEXTURE CACHE |
---|
.. | .. |
---|
8169 | 8184 | texturedata = GetFileTexture(cachename, processbump, resolution); |
---|
8170 | 8185 | |
---|
8171 | 8186 | |
---|
8172 | | - if (texturedata != null) |
---|
| 8187 | + if (texturedata == null) |
---|
| 8188 | + throw new Exception(); |
---|
| 8189 | + |
---|
8173 | 8190 | texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution); |
---|
8174 | 8191 | //texture = GetTexture(tex, bump); |
---|
8175 | 8192 | } |
---|
.. | .. |
---|
8291 | 8308 | return texture; |
---|
8292 | 8309 | } |
---|
8293 | 8310 | |
---|
8294 | | - com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) |
---|
| 8311 | + com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8295 | 8312 | { |
---|
8296 | 8313 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8297 | 8314 | |
---|
.. | .. |
---|
8309 | 8326 | return texture!=null?texture.texture:null; |
---|
8310 | 8327 | } |
---|
8311 | 8328 | |
---|
8312 | | - public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) |
---|
| 8329 | + public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) throws Exception |
---|
8313 | 8330 | { |
---|
8314 | 8331 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8315 | 8332 | |
---|
8316 | 8333 | return texture!=null?texture.texturedata:null; |
---|
8317 | 8334 | } |
---|
8318 | 8335 | |
---|
8319 | | - boolean BindTexture(String tex, boolean bump, int resolution) |
---|
| 8336 | + boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8320 | 8337 | { |
---|
8321 | 8338 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8322 | 8339 | { |
---|
.. | .. |
---|
9382 | 9399 | //gl.glFlush(); |
---|
9383 | 9400 | gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE); |
---|
9384 | 9401 | |
---|
9385 | | - if (ANIMATION && ABORTED) |
---|
| 9402 | + if (Globals.ANIMATION && ABORTED) |
---|
9386 | 9403 | { |
---|
9387 | 9404 | System.err.println(" ABORTED FRAME"); |
---|
9388 | 9405 | break; |
---|
.. | .. |
---|
9412 | 9429 | setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
---|
9413 | 9430 | |
---|
9414 | 9431 | // save image |
---|
9415 | | - if (ANIMATION && !ABORTED) |
---|
| 9432 | + if (Globals.ANIMATION && !ABORTED) |
---|
9416 | 9433 | { |
---|
9417 | 9434 | VPwidth = viewport[2]; |
---|
9418 | 9435 | VPheight = viewport[3]; |
---|
.. | .. |
---|
9523 | 9540 | |
---|
9524 | 9541 | // imagecount++; |
---|
9525 | 9542 | |
---|
9526 | | - String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
| 9543 | + String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
9527 | 9544 | |
---|
9528 | 9545 | if (!BOXMODE) |
---|
9529 | 9546 | { |
---|
9530 | | - System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")"); |
---|
| 9547 | + System.out.println("image: " + fullname + " (wav cursor=" + (Grafreed.wav.cursor / 735 / 4) + ")"); |
---|
9531 | 9548 | } |
---|
9532 | 9549 | |
---|
9533 | 9550 | if (!BOXMODE) |
---|
.. | .. |
---|
9565 | 9582 | ABORTED = false; |
---|
9566 | 9583 | } |
---|
9567 | 9584 | else |
---|
9568 | | - GrafreeD.wav.cursor += 735 * ACSIZE; |
---|
| 9585 | + Grafreed.wav.cursor += 735 * ACSIZE; |
---|
9569 | 9586 | |
---|
9570 | 9587 | if (false) |
---|
9571 | 9588 | { |
---|
.. | .. |
---|
10228 | 10245 | |
---|
10229 | 10246 | public void display(GLAutoDrawable drawable) |
---|
10230 | 10247 | { |
---|
10231 | | - if (GrafreeD.savesound && GrafreeD.hassound) |
---|
| 10248 | + if (Grafreed.savesound && Grafreed.hassound) |
---|
10232 | 10249 | { |
---|
10233 | | - GrafreeD.wav.save(); |
---|
10234 | | - GrafreeD.savesound = false; |
---|
10235 | | - GrafreeD.hassound = false; |
---|
| 10250 | + Grafreed.wav.save(); |
---|
| 10251 | + Grafreed.savesound = false; |
---|
| 10252 | + Grafreed.hassound = false; |
---|
10236 | 10253 | } |
---|
10237 | 10254 | // if (DEBUG_SELECTION) |
---|
10238 | 10255 | // { |
---|
.. | .. |
---|
10362 | 10379 | Object3D theobject = object; |
---|
10363 | 10380 | Object3D theparent = object.parent; |
---|
10364 | 10381 | object.parent = null; |
---|
10365 | | - object = (Object3D)GrafreeD.clone(object); |
---|
| 10382 | + object = (Object3D)Grafreed.clone(object); |
---|
10366 | 10383 | object.Stripify(); |
---|
10367 | 10384 | if (theobject.selection == null || theobject.selection.Size() == 0) |
---|
10368 | 10385 | theobject.PreprocessOcclusion(this); |
---|
.. | .. |
---|
10783 | 10800 | // Bump noise |
---|
10784 | 10801 | gl.glActiveTexture(GL.GL_TEXTURE6); |
---|
10785 | 10802 | //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise); |
---|
10786 | | - BindTexture(NOISE_TEXTURE, false, 2); |
---|
| 10803 | + |
---|
| 10804 | + try |
---|
| 10805 | + { |
---|
| 10806 | + BindTexture(NOISE_TEXTURE, false, 2); |
---|
| 10807 | + } |
---|
| 10808 | + catch (Exception e) |
---|
| 10809 | + { |
---|
| 10810 | + System.err.println("FAILED: " + NOISE_TEXTURE); |
---|
| 10811 | + } |
---|
| 10812 | + |
---|
10787 | 10813 | |
---|
10788 | 10814 | gl.glActiveTexture(GL.GL_TEXTURE0); |
---|
10789 | 10815 | gl.glEnable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11247 | 11273 | { |
---|
11248 | 11274 | renderpass++; |
---|
11249 | 11275 | // System.out.println("Draw object... "); |
---|
| 11276 | + STEP = 1; |
---|
11250 | 11277 | if (FAST) // in case there is no script |
---|
11251 | | - STEP = 16; |
---|
| 11278 | + STEP = 8; |
---|
| 11279 | + |
---|
| 11280 | + if (CURRENTANTIALIAS == 0 || ACSIZE == 1) |
---|
| 11281 | + { |
---|
| 11282 | + STEP *= 4; |
---|
| 11283 | + } |
---|
11252 | 11284 | |
---|
11253 | 11285 | //object.FullInvariants(); |
---|
11254 | 11286 | |
---|
.. | .. |
---|
11262 | 11294 | e.printStackTrace(); |
---|
11263 | 11295 | } |
---|
11264 | 11296 | |
---|
11265 | | - if (GrafreeD.RENDERME > 0) |
---|
11266 | | - GrafreeD.RENDERME--; // mechante magouille |
---|
| 11297 | + if (Grafreed.RENDERME > 0) |
---|
| 11298 | + Grafreed.RENDERME--; // mechante magouille |
---|
11267 | 11299 | |
---|
11268 | 11300 | Globals.ONESTEP = false; |
---|
11269 | 11301 | } |
---|
.. | .. |
---|
11333 | 11365 | |
---|
11334 | 11366 | usedtextures.clear(); |
---|
11335 | 11367 | |
---|
11336 | | - BindTextures(DEFAULT_TEXTURES, 2); |
---|
| 11368 | + try |
---|
| 11369 | + { |
---|
| 11370 | + BindTextures(DEFAULT_TEXTURES, 2); |
---|
| 11371 | + } |
---|
| 11372 | + catch (Exception e) |
---|
| 11373 | + { |
---|
| 11374 | + System.err.println("FAILED: " + DEFAULT_TEXTURES); |
---|
| 11375 | + } |
---|
11337 | 11376 | } |
---|
11338 | 11377 | //System.out.println("--> " + stackdepth); |
---|
11339 | 11378 | // GrafreeD.traceon(); |
---|
.. | .. |
---|
11424 | 11463 | if (checker != null && DrawMode() == DEFAULT) |
---|
11425 | 11464 | { |
---|
11426 | 11465 | //BindTexture(IMMORTAL_TEXTURE); |
---|
11427 | | - BindTextures(checker.GetTextures(), checker.texres); |
---|
| 11466 | + try |
---|
| 11467 | + { |
---|
| 11468 | + BindTextures(checker.GetTextures(), checker.texres); |
---|
| 11469 | + } |
---|
| 11470 | + catch (Exception e) |
---|
| 11471 | + { |
---|
| 11472 | + System.err.println("FAILED: " + checker.GetTextures()); |
---|
| 11473 | + } |
---|
11428 | 11474 | // NEAREST |
---|
11429 | 11475 | GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR); |
---|
11430 | 11476 | DrawChecker(gl); |
---|
.. | .. |
---|
12586 | 12632 | "MAX ndotl.x, ndotl.x, -ndotl.x;" + |
---|
12587 | 12633 | |
---|
12588 | 12634 | "SUB temp.x, one.x, ndotl.x;" + |
---|
12589 | | - "ADD temp.x, temp.x, options2.z;" + // lightsheen |
---|
12590 | | - "ADD temp.y, one.y, options2.y;" + // sursurface |
---|
| 12635 | + // Tuning for default skin |
---|
| 12636 | + //"ADD temp.x, temp.x, options2.z;" + // lightsheen |
---|
| 12637 | + "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen |
---|
| 12638 | + "ADD temp.y, one.y, options2.y;" + // subsurface |
---|
12591 | 12639 | "MUL temp.x, temp.x, temp.y;" + |
---|
12592 | 12640 | |
---|
12593 | 12641 | "MUL saturation, saturation, temp.xxxx;" + |
---|
.. | .. |
---|
13496 | 13544 | public void mousePressed(MouseEvent e) |
---|
13497 | 13545 | { |
---|
13498 | 13546 | //System.out.println("mousePressed: " + e); |
---|
13499 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13547 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13500 | 13548 | } |
---|
13501 | 13549 | |
---|
13502 | 13550 | static long prevtime = 0; |
---|
.. | .. |
---|
13523 | 13571 | |
---|
13524 | 13572 | //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio); |
---|
13525 | 13573 | |
---|
| 13574 | + if (BUTTONLESSWHEEL) |
---|
13526 | 13575 | if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30) |
---|
13527 | 13576 | { |
---|
13528 | 13577 | return; |
---|
.. | .. |
---|
13531 | 13580 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
13532 | 13581 | |
---|
13533 | 13582 | // TIMER |
---|
13534 | | - if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR |
---|
| 13583 | + if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR |
---|
13535 | 13584 | { |
---|
13536 | 13585 | keepboxmode = BOXMODE; |
---|
13537 | 13586 | keepsupport = SUPPORT; |
---|
.. | .. |
---|
13571 | 13620 | // mode |= META; |
---|
13572 | 13621 | //} |
---|
13573 | 13622 | |
---|
13574 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13575 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13623 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13624 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13576 | 13625 | anchorX = ax; |
---|
13577 | 13626 | anchorY = ay; |
---|
13578 | 13627 | prevX = px; |
---|
.. | .. |
---|
13632 | 13681 | // wasliveok = true; |
---|
13633 | 13682 | // waslive = false; |
---|
13634 | 13683 | |
---|
| 13684 | + // May 2019 Forget it: |
---|
| 13685 | + if (true) |
---|
| 13686 | + return; |
---|
| 13687 | + |
---|
13635 | 13688 | // source == timer |
---|
13636 | 13689 | if (mouseDown) |
---|
13637 | 13690 | { |
---|
.. | .. |
---|
13670 | 13723 | |
---|
13671 | 13724 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13672 | 13725 | |
---|
13673 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13726 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13674 | 13727 | { |
---|
13675 | 13728 | if (!wasliveok) |
---|
13676 | 13729 | return; |
---|
.. | .. |
---|
13687 | 13740 | // touched = true; // main DL |
---|
13688 | 13741 | if (isRenderer) |
---|
13689 | 13742 | { |
---|
13690 | | - SetMouseMode(modifiers); |
---|
| 13743 | + SetMouseMode(modifiers, modifiersex); |
---|
13691 | 13744 | } |
---|
13692 | 13745 | |
---|
13693 | 13746 | selectX = anchorX = x; |
---|
.. | .. |
---|
13700 | 13753 | clicked = true; |
---|
13701 | 13754 | hold = false; |
---|
13702 | 13755 | |
---|
13703 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13756 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13704 | 13757 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13705 | 13758 | { |
---|
13706 | 13759 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13731 | 13784 | info.camera = renderCamera; |
---|
13732 | 13785 | info.x = x; |
---|
13733 | 13786 | info.y = y; |
---|
13734 | | - info.modifiers = modifiers; |
---|
| 13787 | + info.modifiers = modifiersex; |
---|
13735 | 13788 | editObj = object.doEditClick(info, 0); |
---|
13736 | 13789 | if (!editObj) |
---|
13737 | 13790 | { |
---|
.. | .. |
---|
13748 | 13801 | |
---|
13749 | 13802 | public void mouseDragged(MouseEvent e) |
---|
13750 | 13803 | { |
---|
| 13804 | + //System.out.println("mouseDragged: " + e); |
---|
13751 | 13805 | if (isRenderer) |
---|
13752 | 13806 | movingcamera = true; |
---|
13753 | 13807 | //if (drawing) |
---|
13754 | 13808 | //return; |
---|
13755 | | - //System.out.println("mouseDragged: " + e); |
---|
13756 | 13809 | if ((e.getModifiersEx() & CTRL) != 0 |
---|
13757 | 13810 | || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen()) |
---|
13758 | 13811 | { |
---|
.. | .. |
---|
13760 | 13813 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13761 | 13814 | } |
---|
13762 | 13815 | else |
---|
13763 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13816 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13764 | 13817 | |
---|
13765 | 13818 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13766 | 13819 | } |
---|
.. | .. |
---|
13933 | 13986 | |
---|
13934 | 13987 | public void run() |
---|
13935 | 13988 | { |
---|
| 13989 | + new Exception().printStackTrace(); |
---|
13936 | 13990 | System.exit(0); |
---|
13937 | 13991 | for (;;) |
---|
13938 | 13992 | { |
---|
.. | .. |
---|
13996 | 14050 | { |
---|
13997 | 14051 | Globals.lighttouched = true; |
---|
13998 | 14052 | } |
---|
13999 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14053 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14000 | 14054 | } |
---|
14001 | 14055 | //else |
---|
14002 | 14056 | } |
---|
.. | .. |
---|
14096 | 14150 | int X, Y; |
---|
14097 | 14151 | boolean SX, SY; |
---|
14098 | 14152 | |
---|
14099 | | - void drag(int x, int y, int modifiers) |
---|
| 14153 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14100 | 14154 | { |
---|
14101 | 14155 | if (IsFrozen()) |
---|
14102 | 14156 | { |
---|
.. | .. |
---|
14105 | 14159 | |
---|
14106 | 14160 | drag = true; // NEW |
---|
14107 | 14161 | |
---|
14108 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14162 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14109 | 14163 | |
---|
14110 | 14164 | X = x; |
---|
14111 | 14165 | Y = y; |
---|
14112 | 14166 | // floating state for animation |
---|
14113 | | - MODIFIERS = modifiers; |
---|
14114 | | - modifiers &= ~1024; |
---|
| 14167 | + MODIFIERS = modifiersex; |
---|
| 14168 | + modifiersex &= ~1024; |
---|
14115 | 14169 | if (false) // modifiers != 0) |
---|
14116 | 14170 | { |
---|
14117 | 14171 | //new Exception().printStackTrace(); |
---|
14118 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14172 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14119 | 14173 | System.out.println("SHIFT = " + SHIFT); |
---|
14120 | 14174 | System.out.println("CONTROL = " + COMMAND); |
---|
14121 | 14175 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14135 | 14189 | info.camera = renderCamera; |
---|
14136 | 14190 | info.x = x; |
---|
14137 | 14191 | info.y = y; |
---|
14138 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14192 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14139 | 14193 | } else |
---|
14140 | 14194 | { |
---|
14141 | 14195 | if (x < startX) |
---|
.. | .. |
---|
14287 | 14341 | public void mouseMoved(MouseEvent e) |
---|
14288 | 14342 | { |
---|
14289 | 14343 | //System.out.println("mouseMoved: " + e); |
---|
14290 | | - |
---|
14291 | 14344 | if (isRenderer) |
---|
14292 | 14345 | return; |
---|
14293 | 14346 | |
---|
.. | .. |
---|
14335 | 14388 | boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection |
---|
14336 | 14389 | boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection |
---|
14337 | 14390 | |
---|
14338 | | - if (control || command || IsFrozen()) |
---|
| 14391 | +// No delay if (control || command || IsFrozen()) |
---|
14339 | 14392 | timeout = true; |
---|
14340 | | - else |
---|
| 14393 | +// ?? May 2019 else |
---|
14341 | 14394 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14342 | 14395 | mouseDown = false; |
---|
14343 | 14396 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14447 | 14500 | System.out.println("keyReleased: " + e); |
---|
14448 | 14501 | } |
---|
14449 | 14502 | |
---|
14450 | | - void SetMouseMode(int modifiers) |
---|
| 14503 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14451 | 14504 | { |
---|
14452 | 14505 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14453 | 14506 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14459 | 14512 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14460 | 14513 | // return; |
---|
14461 | 14514 | //System.out.println("SetMode = " + modifiers); |
---|
14462 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14515 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14463 | 14516 | { |
---|
14464 | 14517 | mouseMode |= ZOOM; |
---|
14465 | 14518 | } |
---|
14466 | 14519 | |
---|
14467 | 14520 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14468 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14521 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14469 | 14522 | { |
---|
14470 | 14523 | mouseMode |= VR; // BACKFORTH; |
---|
14471 | 14524 | } |
---|
14472 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14525 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14473 | 14526 | { |
---|
14474 | 14527 | mouseMode |= SELECT; |
---|
14475 | 14528 | } |
---|
14476 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14529 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14477 | 14530 | { |
---|
14478 | 14531 | mouseMode |= SELECT; |
---|
14479 | 14532 | } |
---|
14480 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14533 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14481 | 14534 | { |
---|
14482 | 14535 | mouseMode &= ~VR; |
---|
14483 | 14536 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14506 | 14559 | |
---|
14507 | 14560 | if (isRenderer) // |
---|
14508 | 14561 | { |
---|
14509 | | - SetMouseMode(modifiers); |
---|
| 14562 | + SetMouseMode(0, modifiers); |
---|
14510 | 14563 | } |
---|
14511 | 14564 | |
---|
14512 | 14565 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14842 | 14895 | //RESIZETEXTURE ^= true; |
---|
14843 | 14896 | //break; |
---|
14844 | 14897 | case 'z': |
---|
14845 | | - RENDERSHADOW ^= true; |
---|
| 14898 | + Globals.RENDERSHADOW ^= true; |
---|
14846 | 14899 | Globals.lighttouched = true; |
---|
14847 | 14900 | repaint(); |
---|
14848 | 14901 | break; |
---|
.. | .. |
---|
14966 | 15019 | //mode = ROTATE; |
---|
14967 | 15020 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14968 | 15021 | { |
---|
14969 | | - SetMouseMode(modifiers); |
---|
| 15022 | + SetMouseMode(0, modifiers); |
---|
14970 | 15023 | } |
---|
14971 | 15024 | } |
---|
14972 | 15025 | |
---|
.. | .. |
---|
15100 | 15153 | |
---|
15101 | 15154 | protected void processMouseMotionEvent(MouseEvent e) |
---|
15102 | 15155 | { |
---|
15103 | | - //System.out.println("processMouseMotionEvent: " + mouseMode); |
---|
15104 | | - if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
| 15156 | + //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
| 15157 | + //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
| 15158 | + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
15105 | 15159 | { |
---|
15106 | 15160 | mouseMoved(e); |
---|
15107 | 15161 | } else |
---|
.. | .. |
---|
15131 | 15185 | |
---|
15132 | 15186 | void SelectParent() |
---|
15133 | 15187 | { |
---|
| 15188 | + new Exception().printStackTrace(); |
---|
15134 | 15189 | System.exit(0); |
---|
15135 | 15190 | Composite group = (Composite) object; |
---|
15136 | 15191 | java.util.Vector selectees = new java.util.Vector(group.selection); |
---|
.. | .. |
---|
15154 | 15209 | |
---|
15155 | 15210 | void SelectChildren() |
---|
15156 | 15211 | { |
---|
| 15212 | + new Exception().printStackTrace(); |
---|
15157 | 15213 | System.exit(0); |
---|
15158 | 15214 | /* |
---|
15159 | 15215 | Composite group = (Composite) object; |
---|
.. | .. |
---|
15536 | 15592 | public boolean mouseDown(Event evt, int x, int y) |
---|
15537 | 15593 | { |
---|
15538 | 15594 | System.out.println("mouseDown: " + evt); |
---|
| 15595 | + System.exit(0); |
---|
15539 | 15596 | /* |
---|
15540 | 15597 | locked = true; |
---|
15541 | 15598 | drag = false; |
---|
.. | .. |
---|
15579 | 15636 | { |
---|
15580 | 15637 | keyPressed(0, modifiers); |
---|
15581 | 15638 | } |
---|
15582 | | - clickStart(x, y, modifiers); |
---|
| 15639 | + // clickStart(x, y, modifiers); |
---|
15583 | 15640 | return true; |
---|
15584 | 15641 | } |
---|
15585 | 15642 | |
---|
.. | .. |
---|
15697 | 15754 | { |
---|
15698 | 15755 | keyReleased(0, 0); |
---|
15699 | 15756 | } |
---|
15700 | | - drag(x, y, modifiers); |
---|
| 15757 | + drag(x, y, 0, modifiers); |
---|
15701 | 15758 | return true; |
---|
15702 | 15759 | } |
---|
15703 | 15760 | |
---|
.. | .. |
---|
16267 | 16324 | { |
---|
16268 | 16325 | if (!selection) |
---|
16269 | 16326 | { |
---|
| 16327 | + new Exception().printStackTrace(); |
---|
16270 | 16328 | System.exit(0); |
---|
16271 | 16329 | return; |
---|
16272 | 16330 | } |
---|
.. | .. |
---|
16394 | 16452 | System.out.println("; fromto " + sel + " " + Trunk(previousselectedpoint.toParent[3][0]) + " " + Trunk(previousselectedpoint.toParent[3][2]) + " " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][2])); |
---|
16395 | 16453 | } |
---|
16396 | 16454 | |
---|
16397 | | - previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint); |
---|
| 16455 | + previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint); |
---|
16398 | 16456 | } |
---|
16399 | 16457 | } |
---|
16400 | 16458 | |
---|
16401 | 16459 | if (!movingcamera && !PAINTMODE) |
---|
16402 | 16460 | object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
16403 | 16461 | |
---|
16404 | | - if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16462 | + if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16405 | 16463 | { |
---|
16406 | | - Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
| 16464 | + Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16407 | 16465 | |
---|
16408 | 16466 | Object3D group = new Object3D("inst" + paintcount++); |
---|
16409 | 16467 | |
---|
.. | .. |
---|
16559 | 16617 | gl.glDisable(gl.GL_CULL_FACE); |
---|
16560 | 16618 | } |
---|
16561 | 16619 | |
---|
16562 | | - if (!RENDERSHADOW) |
---|
| 16620 | + if (!Globals.RENDERSHADOW) |
---|
16563 | 16621 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16564 | 16622 | |
---|
16565 | 16623 | // SB gl.glPolygonOffset(2.5f, 10); |
---|
.. | .. |
---|
16569 | 16627 | //gl.glColorMask(false, false, false, false); |
---|
16570 | 16628 | |
---|
16571 | 16629 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
16572 | | - if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16630 | + if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed()) |
---|
16573 | 16631 | { |
---|
16574 | 16632 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16575 | 16633 | |
---|