.. | .. |
---|
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 | } |
---|
.. | .. |
---|
9542 | 9542 | |
---|
9543 | 9543 | if (!BOXMODE) |
---|
9544 | 9544 | { |
---|
9545 | | - 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) + ")"); |
---|
9546 | 9546 | } |
---|
9547 | 9547 | |
---|
9548 | 9548 | if (!BOXMODE) |
---|
.. | .. |
---|
9580 | 9580 | ABORTED = false; |
---|
9581 | 9581 | } |
---|
9582 | 9582 | else |
---|
9583 | | - GrafreeD.wav.cursor += 735 * ACSIZE; |
---|
| 9583 | + Grafreed.wav.cursor += 735 * ACSIZE; |
---|
9584 | 9584 | |
---|
9585 | 9585 | if (false) |
---|
9586 | 9586 | { |
---|
.. | .. |
---|
10243 | 10243 | |
---|
10244 | 10244 | public void display(GLAutoDrawable drawable) |
---|
10245 | 10245 | { |
---|
10246 | | - if (GrafreeD.savesound && GrafreeD.hassound) |
---|
| 10246 | + if (Grafreed.savesound && Grafreed.hassound) |
---|
10247 | 10247 | { |
---|
10248 | | - GrafreeD.wav.save(); |
---|
10249 | | - GrafreeD.savesound = false; |
---|
10250 | | - GrafreeD.hassound = false; |
---|
| 10248 | + Grafreed.wav.save(); |
---|
| 10249 | + Grafreed.savesound = false; |
---|
| 10250 | + Grafreed.hassound = false; |
---|
10251 | 10251 | } |
---|
10252 | 10252 | // if (DEBUG_SELECTION) |
---|
10253 | 10253 | // { |
---|
.. | .. |
---|
10377 | 10377 | Object3D theobject = object; |
---|
10378 | 10378 | Object3D theparent = object.parent; |
---|
10379 | 10379 | object.parent = null; |
---|
10380 | | - object = (Object3D)GrafreeD.clone(object); |
---|
| 10380 | + object = (Object3D)Grafreed.clone(object); |
---|
10381 | 10381 | object.Stripify(); |
---|
10382 | 10382 | if (theobject.selection == null || theobject.selection.Size() == 0) |
---|
10383 | 10383 | theobject.PreprocessOcclusion(this); |
---|
.. | .. |
---|
11283 | 11283 | e.printStackTrace(); |
---|
11284 | 11284 | } |
---|
11285 | 11285 | |
---|
11286 | | - if (GrafreeD.RENDERME > 0) |
---|
11287 | | - GrafreeD.RENDERME--; // mechante magouille |
---|
| 11286 | + if (Grafreed.RENDERME > 0) |
---|
| 11287 | + Grafreed.RENDERME--; // mechante magouille |
---|
11288 | 11288 | |
---|
11289 | 11289 | Globals.ONESTEP = false; |
---|
11290 | 11290 | } |
---|
.. | .. |
---|
13519 | 13519 | public void mousePressed(MouseEvent e) |
---|
13520 | 13520 | { |
---|
13521 | 13521 | //System.out.println("mousePressed: " + e); |
---|
13522 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13522 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13523 | 13523 | } |
---|
13524 | 13524 | |
---|
13525 | 13525 | static long prevtime = 0; |
---|
.. | .. |
---|
13595 | 13595 | // mode |= META; |
---|
13596 | 13596 | //} |
---|
13597 | 13597 | |
---|
13598 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13599 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13598 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13599 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13600 | 13600 | anchorX = ax; |
---|
13601 | 13601 | anchorY = ay; |
---|
13602 | 13602 | prevX = px; |
---|
.. | .. |
---|
13656 | 13656 | // wasliveok = true; |
---|
13657 | 13657 | // waslive = false; |
---|
13658 | 13658 | |
---|
| 13659 | + // May 2019 Forget it: |
---|
| 13660 | + if (true) |
---|
| 13661 | + return; |
---|
| 13662 | + |
---|
13659 | 13663 | // source == timer |
---|
13660 | 13664 | if (mouseDown) |
---|
13661 | 13665 | { |
---|
.. | .. |
---|
13694 | 13698 | |
---|
13695 | 13699 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13696 | 13700 | |
---|
13697 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13701 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13698 | 13702 | { |
---|
13699 | 13703 | if (!wasliveok) |
---|
13700 | 13704 | return; |
---|
.. | .. |
---|
13711 | 13715 | // touched = true; // main DL |
---|
13712 | 13716 | if (isRenderer) |
---|
13713 | 13717 | { |
---|
13714 | | - SetMouseMode(modifiers); |
---|
| 13718 | + SetMouseMode(modifiers, modifiersex); |
---|
13715 | 13719 | } |
---|
13716 | 13720 | |
---|
13717 | 13721 | selectX = anchorX = x; |
---|
.. | .. |
---|
13724 | 13728 | clicked = true; |
---|
13725 | 13729 | hold = false; |
---|
13726 | 13730 | |
---|
13727 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13731 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13728 | 13732 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13729 | 13733 | { |
---|
13730 | 13734 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13755 | 13759 | info.camera = renderCamera; |
---|
13756 | 13760 | info.x = x; |
---|
13757 | 13761 | info.y = y; |
---|
13758 | | - info.modifiers = modifiers; |
---|
| 13762 | + info.modifiers = modifiersex; |
---|
13759 | 13763 | editObj = object.doEditClick(info, 0); |
---|
13760 | 13764 | if (!editObj) |
---|
13761 | 13765 | { |
---|
.. | .. |
---|
13784 | 13788 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13785 | 13789 | } |
---|
13786 | 13790 | else |
---|
13787 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13791 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13788 | 13792 | |
---|
13789 | 13793 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13790 | 13794 | } |
---|
.. | .. |
---|
14021 | 14025 | { |
---|
14022 | 14026 | Globals.lighttouched = true; |
---|
14023 | 14027 | } |
---|
14024 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14028 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14025 | 14029 | } |
---|
14026 | 14030 | //else |
---|
14027 | 14031 | } |
---|
.. | .. |
---|
14121 | 14125 | int X, Y; |
---|
14122 | 14126 | boolean SX, SY; |
---|
14123 | 14127 | |
---|
14124 | | - void drag(int x, int y, int modifiers) |
---|
| 14128 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14125 | 14129 | { |
---|
14126 | 14130 | if (IsFrozen()) |
---|
14127 | 14131 | { |
---|
.. | .. |
---|
14130 | 14134 | |
---|
14131 | 14135 | drag = true; // NEW |
---|
14132 | 14136 | |
---|
14133 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14137 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14134 | 14138 | |
---|
14135 | 14139 | X = x; |
---|
14136 | 14140 | Y = y; |
---|
14137 | 14141 | // floating state for animation |
---|
14138 | | - MODIFIERS = modifiers; |
---|
14139 | | - modifiers &= ~1024; |
---|
| 14142 | + MODIFIERS = modifiersex; |
---|
| 14143 | + modifiersex &= ~1024; |
---|
14140 | 14144 | if (false) // modifiers != 0) |
---|
14141 | 14145 | { |
---|
14142 | 14146 | //new Exception().printStackTrace(); |
---|
14143 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14147 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14144 | 14148 | System.out.println("SHIFT = " + SHIFT); |
---|
14145 | 14149 | System.out.println("CONTROL = " + COMMAND); |
---|
14146 | 14150 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14160 | 14164 | info.camera = renderCamera; |
---|
14161 | 14165 | info.x = x; |
---|
14162 | 14166 | info.y = y; |
---|
14163 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14167 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14164 | 14168 | } else |
---|
14165 | 14169 | { |
---|
14166 | 14170 | if (x < startX) |
---|
.. | .. |
---|
14359 | 14363 | boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection |
---|
14360 | 14364 | boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection |
---|
14361 | 14365 | |
---|
14362 | | - if (control || command || IsFrozen()) |
---|
| 14366 | +// No delay if (control || command || IsFrozen()) |
---|
14363 | 14367 | timeout = true; |
---|
14364 | | - else |
---|
| 14368 | +// ?? May 2019 else |
---|
14365 | 14369 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14366 | 14370 | mouseDown = false; |
---|
14367 | 14371 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14471 | 14475 | System.out.println("keyReleased: " + e); |
---|
14472 | 14476 | } |
---|
14473 | 14477 | |
---|
14474 | | - void SetMouseMode(int modifiers) |
---|
| 14478 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14475 | 14479 | { |
---|
14476 | 14480 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14477 | 14481 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14483 | 14487 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14484 | 14488 | // return; |
---|
14485 | 14489 | //System.out.println("SetMode = " + modifiers); |
---|
14486 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14490 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14487 | 14491 | { |
---|
14488 | 14492 | mouseMode |= ZOOM; |
---|
14489 | 14493 | } |
---|
.. | .. |
---|
14493 | 14497 | { |
---|
14494 | 14498 | mouseMode |= VR; // BACKFORTH; |
---|
14495 | 14499 | } |
---|
14496 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14500 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14497 | 14501 | { |
---|
14498 | 14502 | mouseMode |= SELECT; |
---|
14499 | 14503 | } |
---|
14500 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14504 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14501 | 14505 | { |
---|
14502 | 14506 | mouseMode |= SELECT; |
---|
14503 | 14507 | } |
---|
14504 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14508 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14505 | 14509 | { |
---|
14506 | 14510 | mouseMode &= ~VR; |
---|
14507 | 14511 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14530 | 14534 | |
---|
14531 | 14535 | if (isRenderer) // |
---|
14532 | 14536 | { |
---|
14533 | | - SetMouseMode(modifiers); |
---|
| 14537 | + SetMouseMode(0, modifiers); |
---|
14534 | 14538 | } |
---|
14535 | 14539 | |
---|
14536 | 14540 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14866 | 14870 | //RESIZETEXTURE ^= true; |
---|
14867 | 14871 | //break; |
---|
14868 | 14872 | case 'z': |
---|
14869 | | - RENDERSHADOW ^= true; |
---|
| 14873 | + Globals.RENDERSHADOW ^= true; |
---|
14870 | 14874 | Globals.lighttouched = true; |
---|
14871 | 14875 | repaint(); |
---|
14872 | 14876 | break; |
---|
.. | .. |
---|
14990 | 14994 | //mode = ROTATE; |
---|
14991 | 14995 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14992 | 14996 | { |
---|
14993 | | - SetMouseMode(modifiers); |
---|
| 14997 | + SetMouseMode(0, modifiers); |
---|
14994 | 14998 | } |
---|
14995 | 14999 | } |
---|
14996 | 15000 | |
---|
.. | .. |
---|
15563 | 15567 | public boolean mouseDown(Event evt, int x, int y) |
---|
15564 | 15568 | { |
---|
15565 | 15569 | System.out.println("mouseDown: " + evt); |
---|
| 15570 | + System.exit(0); |
---|
15566 | 15571 | /* |
---|
15567 | 15572 | locked = true; |
---|
15568 | 15573 | drag = false; |
---|
.. | .. |
---|
15606 | 15611 | { |
---|
15607 | 15612 | keyPressed(0, modifiers); |
---|
15608 | 15613 | } |
---|
15609 | | - clickStart(x, y, modifiers); |
---|
| 15614 | + // clickStart(x, y, modifiers); |
---|
15610 | 15615 | return true; |
---|
15611 | 15616 | } |
---|
15612 | 15617 | |
---|
.. | .. |
---|
15724 | 15729 | { |
---|
15725 | 15730 | keyReleased(0, 0); |
---|
15726 | 15731 | } |
---|
15727 | | - drag(x, y, modifiers); |
---|
| 15732 | + drag(x, y, 0, modifiers); |
---|
15728 | 15733 | return true; |
---|
15729 | 15734 | } |
---|
15730 | 15735 | |
---|
.. | .. |
---|
16422 | 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])); |
---|
16423 | 16428 | } |
---|
16424 | 16429 | |
---|
16425 | | - previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint); |
---|
| 16430 | + previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint); |
---|
16426 | 16431 | } |
---|
16427 | 16432 | } |
---|
16428 | 16433 | |
---|
16429 | 16434 | if (!movingcamera && !PAINTMODE) |
---|
16430 | 16435 | object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
16431 | 16436 | |
---|
16432 | | - 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) |
---|
16433 | 16438 | { |
---|
16434 | | - 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); |
---|
16435 | 16440 | |
---|
16436 | 16441 | Object3D group = new Object3D("inst" + paintcount++); |
---|
16437 | 16442 | |
---|
.. | .. |
---|
16587 | 16592 | gl.glDisable(gl.GL_CULL_FACE); |
---|
16588 | 16593 | } |
---|
16589 | 16594 | |
---|
16590 | | - if (!RENDERSHADOW) |
---|
| 16595 | + if (!Globals.RENDERSHADOW) |
---|
16591 | 16596 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16592 | 16597 | |
---|
16593 | 16598 | // SB gl.glPolygonOffset(2.5f, 10); |
---|
.. | .. |
---|
16597 | 16602 | //gl.glColorMask(false, false, false, false); |
---|
16598 | 16603 | |
---|
16599 | 16604 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
16600 | | - if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16605 | + if (Globals.RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
16601 | 16606 | { |
---|
16602 | 16607 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16603 | 16608 | |
---|