.. | .. |
---|
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 | |
---|
.. | .. |
---|
1628 | 1628 | |
---|
1629 | 1629 | cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0); |
---|
1630 | 1630 | |
---|
1631 | | - float[] colorV = GrafreeD.colorV; |
---|
| 1631 | + float[] colorV = Grafreed.colorV; |
---|
1632 | 1632 | |
---|
1633 | 1633 | /**/ |
---|
1634 | 1634 | if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0) |
---|
.. | .. |
---|
2140 | 2140 | System.err.println("LIVE = " + Globals.isLIVE()); |
---|
2141 | 2141 | |
---|
2142 | 2142 | if (!Globals.isLIVE()) // save sound |
---|
2143 | | - GrafreeD.savesound = true; // wav.save(); |
---|
| 2143 | + Grafreed.savesound = true; // wav.save(); |
---|
2144 | 2144 | // else |
---|
2145 | 2145 | repaint(); // start loop // may 2013 |
---|
2146 | 2146 | } |
---|
.. | .. |
---|
2267 | 2267 | |
---|
2268 | 2268 | void ToggleRandom() |
---|
2269 | 2269 | { |
---|
2270 | | - RANDOM ^= true; |
---|
| 2270 | + SWITCH ^= true; |
---|
2271 | 2271 | } |
---|
2272 | 2272 | |
---|
2273 | 2273 | void ToggleHandles() |
---|
.. | .. |
---|
8075 | 8075 | { |
---|
8076 | 8076 | String texname = tex; |
---|
8077 | 8077 | |
---|
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; |
---|
| 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 | + } |
---|
8084 | 8088 | |
---|
8085 | 8089 | if (CACHETEXTURE) |
---|
8086 | 8090 | texture = textures.get(texname); // TEXTURE CACHE |
---|
.. | .. |
---|
9538 | 9542 | |
---|
9539 | 9543 | if (!BOXMODE) |
---|
9540 | 9544 | { |
---|
9541 | | - System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")"); |
---|
| 9545 | + System.out.println("image: " + fullname + " (wav cursor=" + (Grafreed.wav.cursor / 735 / 4) + ")"); |
---|
9542 | 9546 | } |
---|
9543 | 9547 | |
---|
9544 | 9548 | if (!BOXMODE) |
---|
.. | .. |
---|
9576 | 9580 | ABORTED = false; |
---|
9577 | 9581 | } |
---|
9578 | 9582 | else |
---|
9579 | | - GrafreeD.wav.cursor += 735 * ACSIZE; |
---|
| 9583 | + Grafreed.wav.cursor += 735 * ACSIZE; |
---|
9580 | 9584 | |
---|
9581 | 9585 | if (false) |
---|
9582 | 9586 | { |
---|
.. | .. |
---|
10239 | 10243 | |
---|
10240 | 10244 | public void display(GLAutoDrawable drawable) |
---|
10241 | 10245 | { |
---|
10242 | | - if (GrafreeD.savesound && GrafreeD.hassound) |
---|
| 10246 | + if (Grafreed.savesound && Grafreed.hassound) |
---|
10243 | 10247 | { |
---|
10244 | | - GrafreeD.wav.save(); |
---|
10245 | | - GrafreeD.savesound = false; |
---|
10246 | | - GrafreeD.hassound = false; |
---|
| 10248 | + Grafreed.wav.save(); |
---|
| 10249 | + Grafreed.savesound = false; |
---|
| 10250 | + Grafreed.hassound = false; |
---|
10247 | 10251 | } |
---|
10248 | 10252 | // if (DEBUG_SELECTION) |
---|
10249 | 10253 | // { |
---|
.. | .. |
---|
10373 | 10377 | Object3D theobject = object; |
---|
10374 | 10378 | Object3D theparent = object.parent; |
---|
10375 | 10379 | object.parent = null; |
---|
10376 | | - object = (Object3D)GrafreeD.clone(object); |
---|
| 10380 | + object = (Object3D)Grafreed.clone(object); |
---|
10377 | 10381 | object.Stripify(); |
---|
10378 | 10382 | if (theobject.selection == null || theobject.selection.Size() == 0) |
---|
10379 | 10383 | theobject.PreprocessOcclusion(this); |
---|
.. | .. |
---|
11279 | 11283 | e.printStackTrace(); |
---|
11280 | 11284 | } |
---|
11281 | 11285 | |
---|
11282 | | - if (GrafreeD.RENDERME > 0) |
---|
11283 | | - GrafreeD.RENDERME--; // mechante magouille |
---|
| 11286 | + if (Grafreed.RENDERME > 0) |
---|
| 11287 | + Grafreed.RENDERME--; // mechante magouille |
---|
11284 | 11288 | |
---|
11285 | 11289 | Globals.ONESTEP = false; |
---|
11286 | 11290 | } |
---|
.. | .. |
---|
12754 | 12758 | "MUL final.y, fragment.texcoord[0].x, c256;" + |
---|
12755 | 12759 | "FLR final.x, final.y;" + |
---|
12756 | 12760 | "SUB final.y, final.y, final.x;" + |
---|
12757 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12761 | + "MUL final.x, final.x, c256i;" + |
---|
12758 | 12762 | "MOV final.z, zero.x;" + |
---|
12759 | 12763 | "MOV final.a, one.w;":"" |
---|
12760 | 12764 | ) + |
---|
.. | .. |
---|
12762 | 12766 | "MUL final.y, fragment.texcoord[0].y, c256;" + |
---|
12763 | 12767 | "FLR final.x, final.y;" + |
---|
12764 | 12768 | "SUB final.y, final.y, final.x;" + |
---|
12765 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12769 | + "MUL final.x, final.x, c256i;" + |
---|
12766 | 12770 | "MOV final.z, zero.x;" + |
---|
12767 | 12771 | "MOV final.a, one.w;":"" |
---|
12768 | 12772 | ) + |
---|
.. | .. |
---|
13515 | 13519 | public void mousePressed(MouseEvent e) |
---|
13516 | 13520 | { |
---|
13517 | 13521 | //System.out.println("mousePressed: " + e); |
---|
13518 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13522 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13519 | 13523 | } |
---|
13520 | 13524 | |
---|
13521 | 13525 | static long prevtime = 0; |
---|
.. | .. |
---|
13591 | 13595 | // mode |= META; |
---|
13592 | 13596 | //} |
---|
13593 | 13597 | |
---|
13594 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13595 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13598 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13599 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13596 | 13600 | anchorX = ax; |
---|
13597 | 13601 | anchorY = ay; |
---|
13598 | 13602 | prevX = px; |
---|
.. | .. |
---|
13652 | 13656 | // wasliveok = true; |
---|
13653 | 13657 | // waslive = false; |
---|
13654 | 13658 | |
---|
| 13659 | + // May 2019 Forget it: |
---|
| 13660 | + if (true) |
---|
| 13661 | + return; |
---|
| 13662 | + |
---|
13655 | 13663 | // source == timer |
---|
13656 | 13664 | if (mouseDown) |
---|
13657 | 13665 | { |
---|
.. | .. |
---|
13690 | 13698 | |
---|
13691 | 13699 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13692 | 13700 | |
---|
13693 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13701 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13694 | 13702 | { |
---|
13695 | 13703 | if (!wasliveok) |
---|
13696 | 13704 | return; |
---|
.. | .. |
---|
13707 | 13715 | // touched = true; // main DL |
---|
13708 | 13716 | if (isRenderer) |
---|
13709 | 13717 | { |
---|
13710 | | - SetMouseMode(modifiers); |
---|
| 13718 | + SetMouseMode(modifiers, modifiersex); |
---|
13711 | 13719 | } |
---|
13712 | 13720 | |
---|
13713 | 13721 | selectX = anchorX = x; |
---|
.. | .. |
---|
13720 | 13728 | clicked = true; |
---|
13721 | 13729 | hold = false; |
---|
13722 | 13730 | |
---|
13723 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13731 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13724 | 13732 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13725 | 13733 | { |
---|
13726 | 13734 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13751 | 13759 | info.camera = renderCamera; |
---|
13752 | 13760 | info.x = x; |
---|
13753 | 13761 | info.y = y; |
---|
13754 | | - info.modifiers = modifiers; |
---|
| 13762 | + info.modifiers = modifiersex; |
---|
13755 | 13763 | editObj = object.doEditClick(info, 0); |
---|
13756 | 13764 | if (!editObj) |
---|
13757 | 13765 | { |
---|
.. | .. |
---|
13780 | 13788 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13781 | 13789 | } |
---|
13782 | 13790 | else |
---|
13783 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13791 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13784 | 13792 | |
---|
13785 | 13793 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13786 | 13794 | } |
---|
.. | .. |
---|
14017 | 14025 | { |
---|
14018 | 14026 | Globals.lighttouched = true; |
---|
14019 | 14027 | } |
---|
14020 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14028 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14021 | 14029 | } |
---|
14022 | 14030 | //else |
---|
14023 | 14031 | } |
---|
.. | .. |
---|
14117 | 14125 | int X, Y; |
---|
14118 | 14126 | boolean SX, SY; |
---|
14119 | 14127 | |
---|
14120 | | - void drag(int x, int y, int modifiers) |
---|
| 14128 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14121 | 14129 | { |
---|
14122 | 14130 | if (IsFrozen()) |
---|
14123 | 14131 | { |
---|
.. | .. |
---|
14126 | 14134 | |
---|
14127 | 14135 | drag = true; // NEW |
---|
14128 | 14136 | |
---|
14129 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14137 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14130 | 14138 | |
---|
14131 | 14139 | X = x; |
---|
14132 | 14140 | Y = y; |
---|
14133 | 14141 | // floating state for animation |
---|
14134 | | - MODIFIERS = modifiers; |
---|
14135 | | - modifiers &= ~1024; |
---|
| 14142 | + MODIFIERS = modifiersex; |
---|
| 14143 | + modifiersex &= ~1024; |
---|
14136 | 14144 | if (false) // modifiers != 0) |
---|
14137 | 14145 | { |
---|
14138 | 14146 | //new Exception().printStackTrace(); |
---|
14139 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14147 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14140 | 14148 | System.out.println("SHIFT = " + SHIFT); |
---|
14141 | 14149 | System.out.println("CONTROL = " + COMMAND); |
---|
14142 | 14150 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14156 | 14164 | info.camera = renderCamera; |
---|
14157 | 14165 | info.x = x; |
---|
14158 | 14166 | info.y = y; |
---|
14159 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14167 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14160 | 14168 | } else |
---|
14161 | 14169 | { |
---|
14162 | 14170 | if (x < startX) |
---|
.. | .. |
---|
14355 | 14363 | boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection |
---|
14356 | 14364 | boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection |
---|
14357 | 14365 | |
---|
14358 | | - if (control || command || IsFrozen()) |
---|
| 14366 | +// No delay if (control || command || IsFrozen()) |
---|
14359 | 14367 | timeout = true; |
---|
14360 | | - else |
---|
| 14368 | +// ?? May 2019 else |
---|
14361 | 14369 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14362 | 14370 | mouseDown = false; |
---|
14363 | 14371 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14467 | 14475 | System.out.println("keyReleased: " + e); |
---|
14468 | 14476 | } |
---|
14469 | 14477 | |
---|
14470 | | - void SetMouseMode(int modifiers) |
---|
| 14478 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14471 | 14479 | { |
---|
14472 | 14480 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14473 | 14481 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14479 | 14487 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14480 | 14488 | // return; |
---|
14481 | 14489 | //System.out.println("SetMode = " + modifiers); |
---|
14482 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14490 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14483 | 14491 | { |
---|
14484 | 14492 | mouseMode |= ZOOM; |
---|
14485 | 14493 | } |
---|
14486 | 14494 | |
---|
14487 | 14495 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14488 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14496 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14489 | 14497 | { |
---|
14490 | 14498 | mouseMode |= VR; // BACKFORTH; |
---|
14491 | 14499 | } |
---|
14492 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14500 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14493 | 14501 | { |
---|
14494 | 14502 | mouseMode |= SELECT; |
---|
14495 | 14503 | } |
---|
14496 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14504 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14497 | 14505 | { |
---|
14498 | 14506 | mouseMode |= SELECT; |
---|
14499 | 14507 | } |
---|
14500 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14508 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14501 | 14509 | { |
---|
14502 | 14510 | mouseMode &= ~VR; |
---|
14503 | 14511 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14526 | 14534 | |
---|
14527 | 14535 | if (isRenderer) // |
---|
14528 | 14536 | { |
---|
14529 | | - SetMouseMode(modifiers); |
---|
| 14537 | + SetMouseMode(0, modifiers); |
---|
14530 | 14538 | } |
---|
14531 | 14539 | |
---|
14532 | 14540 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14986 | 14994 | //mode = ROTATE; |
---|
14987 | 14995 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14988 | 14996 | { |
---|
14989 | | - SetMouseMode(modifiers); |
---|
| 14997 | + SetMouseMode(0, modifiers); |
---|
14990 | 14998 | } |
---|
14991 | 14999 | } |
---|
14992 | 15000 | |
---|
.. | .. |
---|
15122 | 15130 | { |
---|
15123 | 15131 | //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
15124 | 15132 | //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
15125 | | - if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
| 15133 | + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
15126 | 15134 | { |
---|
15127 | 15135 | mouseMoved(e); |
---|
15128 | 15136 | } else |
---|
.. | .. |
---|
15559 | 15567 | public boolean mouseDown(Event evt, int x, int y) |
---|
15560 | 15568 | { |
---|
15561 | 15569 | System.out.println("mouseDown: " + evt); |
---|
| 15570 | + System.exit(0); |
---|
15562 | 15571 | /* |
---|
15563 | 15572 | locked = true; |
---|
15564 | 15573 | drag = false; |
---|
.. | .. |
---|
15602 | 15611 | { |
---|
15603 | 15612 | keyPressed(0, modifiers); |
---|
15604 | 15613 | } |
---|
15605 | | - clickStart(x, y, modifiers); |
---|
| 15614 | + // clickStart(x, y, modifiers); |
---|
15606 | 15615 | return true; |
---|
15607 | 15616 | } |
---|
15608 | 15617 | |
---|
.. | .. |
---|
15720 | 15729 | { |
---|
15721 | 15730 | keyReleased(0, 0); |
---|
15722 | 15731 | } |
---|
15723 | | - drag(x, y, modifiers); |
---|
| 15732 | + drag(x, y, 0, modifiers); |
---|
15724 | 15733 | return true; |
---|
15725 | 15734 | } |
---|
15726 | 15735 | |
---|
.. | .. |
---|
16418 | 16427 | 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])); |
---|
16419 | 16428 | } |
---|
16420 | 16429 | |
---|
16421 | | - previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint); |
---|
| 16430 | + previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint); |
---|
16422 | 16431 | } |
---|
16423 | 16432 | } |
---|
16424 | 16433 | |
---|
16425 | 16434 | if (!movingcamera && !PAINTMODE) |
---|
16426 | 16435 | object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
16427 | 16436 | |
---|
16428 | | - if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16437 | + if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16429 | 16438 | { |
---|
16430 | | - Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
| 16439 | + Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16431 | 16440 | |
---|
16432 | 16441 | Object3D group = new Object3D("inst" + paintcount++); |
---|
16433 | 16442 | |
---|