Normand Briere
2019-05-13 f924d3e00db476c06f55f3d5aaef307e17575340
CameraPane.java
....@@ -1628,7 +1628,7 @@
16281628
16291629 cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
16301630
1631
- float[] colorV = GrafreeD.colorV;
1631
+ float[] colorV = Grafreed.colorV;
16321632
16331633 /**/
16341634 if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0)
....@@ -2140,7 +2140,7 @@
21402140 System.err.println("LIVE = " + Globals.isLIVE());
21412141
21422142 if (!Globals.isLIVE()) // save sound
2143
- GrafreeD.savesound = true; // wav.save();
2143
+ Grafreed.savesound = true; // wav.save();
21442144 // else
21452145 repaint(); // start loop // may 2013
21462146 }
....@@ -9542,7 +9542,7 @@
95429542
95439543 if (!BOXMODE)
95449544 {
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) + ")");
95469546 }
95479547
95489548 if (!BOXMODE)
....@@ -9580,7 +9580,7 @@
95809580 ABORTED = false;
95819581 }
95829582 else
9583
- GrafreeD.wav.cursor += 735 * ACSIZE;
9583
+ Grafreed.wav.cursor += 735 * ACSIZE;
95849584
95859585 if (false)
95869586 {
....@@ -10243,11 +10243,11 @@
1024310243
1024410244 public void display(GLAutoDrawable drawable)
1024510245 {
10246
- if (GrafreeD.savesound && GrafreeD.hassound)
10246
+ if (Grafreed.savesound && Grafreed.hassound)
1024710247 {
10248
- GrafreeD.wav.save();
10249
- GrafreeD.savesound = false;
10250
- GrafreeD.hassound = false;
10248
+ Grafreed.wav.save();
10249
+ Grafreed.savesound = false;
10250
+ Grafreed.hassound = false;
1025110251 }
1025210252 // if (DEBUG_SELECTION)
1025310253 // {
....@@ -10377,7 +10377,7 @@
1037710377 Object3D theobject = object;
1037810378 Object3D theparent = object.parent;
1037910379 object.parent = null;
10380
- object = (Object3D)GrafreeD.clone(object);
10380
+ object = (Object3D)Grafreed.clone(object);
1038110381 object.Stripify();
1038210382 if (theobject.selection == null || theobject.selection.Size() == 0)
1038310383 theobject.PreprocessOcclusion(this);
....@@ -11283,8 +11283,8 @@
1128311283 e.printStackTrace();
1128411284 }
1128511285
11286
- if (GrafreeD.RENDERME > 0)
11287
- GrafreeD.RENDERME--; // mechante magouille
11286
+ if (Grafreed.RENDERME > 0)
11287
+ Grafreed.RENDERME--; // mechante magouille
1128811288
1128911289 Globals.ONESTEP = false;
1129011290 }
....@@ -13519,7 +13519,7 @@
1351913519 public void mousePressed(MouseEvent e)
1352013520 {
1352113521 //System.out.println("mousePressed: " + e);
13522
- clickStart(e.getX(), e.getY(), e.getModifiersEx());
13522
+ clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1352313523 }
1352413524
1352513525 static long prevtime = 0;
....@@ -13595,8 +13595,8 @@
1359513595 // mode |= META;
1359613596 //}
1359713597
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);
1360013600 anchorX = ax;
1360113601 anchorY = ay;
1360213602 prevX = px;
....@@ -13656,6 +13656,10 @@
1365613656 // wasliveok = true;
1365713657 // waslive = false;
1365813658
13659
+ // May 2019 Forget it:
13660
+ if (true)
13661
+ return;
13662
+
1365913663 // source == timer
1366013664 if (mouseDown)
1366113665 {
....@@ -13694,7 +13698,7 @@
1369413698
1369513699 javax.swing.Timer timer = new javax.swing.Timer(350, this);
1369613700
13697
- void clickStart(int x, int y, int modifiers)
13701
+ void clickStart(int x, int y, int modifiers, int modifiersex)
1369813702 {
1369913703 if (!wasliveok)
1370013704 return;
....@@ -13711,7 +13715,7 @@
1371113715 // touched = true; // main DL
1371213716 if (isRenderer)
1371313717 {
13714
- SetMouseMode(modifiers);
13718
+ SetMouseMode(modifiers, modifiersex);
1371513719 }
1371613720
1371713721 selectX = anchorX = x;
....@@ -13724,7 +13728,7 @@
1372413728 clicked = true;
1372513729 hold = false;
1372613730
13727
- if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection
13731
+ if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection
1372813732 // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection
1372913733 {
1373013734 // System.out.println("RESTART II " + modifiers);
....@@ -13755,7 +13759,7 @@
1375513759 info.camera = renderCamera;
1375613760 info.x = x;
1375713761 info.y = y;
13758
- info.modifiers = modifiers;
13762
+ info.modifiers = modifiersex;
1375913763 editObj = object.doEditClick(info, 0);
1376013764 if (!editObj)
1376113765 {
....@@ -13784,7 +13788,7 @@
1378413788 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1378513789 }
1378613790 else
13787
- drag(e.getX(), e.getY(), e.getModifiersEx());
13791
+ drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1378813792
1378913793 //try { Thread.sleep(1); } catch (Exception ex) {}
1379013794 }
....@@ -14021,7 +14025,7 @@
1402114025 {
1402214026 Globals.lighttouched = true;
1402314027 }
14024
- drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS);
14028
+ drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS);
1402514029 }
1402614030 //else
1402714031 }
....@@ -14121,7 +14125,7 @@
1412114125 int X, Y;
1412214126 boolean SX, SY;
1412314127
14124
- void drag(int x, int y, int modifiers)
14128
+ void drag(int x, int y, int modifiers, int modifiersex)
1412514129 {
1412614130 if (IsFrozen())
1412714131 {
....@@ -14130,17 +14134,17 @@
1413014134
1413114135 drag = true; // NEW
1413214136
14133
- boolean continuous = (modifiers & COMMAND) == COMMAND;
14137
+ boolean continuous = (modifiersex & COMMAND) == COMMAND;
1413414138
1413514139 X = x;
1413614140 Y = y;
1413714141 // floating state for animation
14138
- MODIFIERS = modifiers;
14139
- modifiers &= ~1024;
14142
+ MODIFIERS = modifiersex;
14143
+ modifiersex &= ~1024;
1414014144 if (false) // modifiers != 0)
1414114145 {
1414214146 //new Exception().printStackTrace();
14143
- System.out.println("mouseDragged: " + modifiers);
14147
+ System.out.println("mouseDragged: " + modifiersex);
1414414148 System.out.println("SHIFT = " + SHIFT);
1414514149 System.out.println("CONTROL = " + COMMAND);
1414614150 System.out.println("META = " + META);
....@@ -14160,7 +14164,7 @@
1416014164 info.camera = renderCamera;
1416114165 info.x = x;
1416214166 info.y = y;
14163
- object.editWindow.copy.doEditDrag(info);
14167
+ object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1416414168 } else
1416514169 {
1416614170 if (x < startX)
....@@ -14359,9 +14363,9 @@
1435914363 boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection
1436014364 boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection
1436114365
14362
- if (control || command || IsFrozen())
14366
+// No delay if (control || command || IsFrozen())
1436314367 timeout = true;
14364
- else
14368
+// ?? May 2019 else
1436514369 // timer.setDelay((modifiers & 128) != 0?0:350);
1436614370 mouseDown = false;
1436714371 if (!control && !command) // june 2013
....@@ -14471,7 +14475,7 @@
1447114475 System.out.println("keyReleased: " + e);
1447214476 }
1447314477
14474
- void SetMouseMode(int modifiers)
14478
+ void SetMouseMode(int modifiers, int modifiersex)
1447514479 {
1447614480 //System.out.println("SetMouseMode = " + modifiers);
1447714481 //modifiers &= ~1024;
....@@ -14483,7 +14487,7 @@
1448314487 //if (modifiers == 0) // || (modifiers == (1024 | CONTROL)))
1448414488 // return;
1448514489 //System.out.println("SetMode = " + modifiers);
14486
- if ((modifiers & WHEEL) == WHEEL)
14490
+ if ((modifiersex & WHEEL) == WHEEL)
1448714491 {
1448814492 mouseMode |= ZOOM;
1448914493 }
....@@ -14493,15 +14497,15 @@
1449314497 {
1449414498 mouseMode |= VR; // BACKFORTH;
1449514499 }
14496
- if ((modifiers & CTRLCLICK) == CTRLCLICK)
14500
+ if ((modifiersex & CTRLCLICK) == CTRLCLICK)
1449714501 {
1449814502 mouseMode |= SELECT;
1449914503 }
14500
- if ((modifiers & COMMAND) == COMMAND)
14504
+ if ((modifiersex & COMMAND) == COMMAND)
1450114505 {
1450214506 mouseMode |= SELECT;
1450314507 }
14504
- if ((modifiers & SHIFT) == SHIFT || forcetranslate)
14508
+ if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1450514509 {
1450614510 mouseMode &= ~VR;
1450714511 mouseMode |= TRANSLATE;
....@@ -14530,7 +14534,7 @@
1453014534
1453114535 if (isRenderer) //
1453214536 {
14533
- SetMouseMode(modifiers);
14537
+ SetMouseMode(0, modifiers);
1453414538 }
1453514539
1453614540 Globals.theRenderer.keyPressed(key);
....@@ -14866,7 +14870,7 @@
1486614870 //RESIZETEXTURE ^= true;
1486714871 //break;
1486814872 case 'z':
14869
- RENDERSHADOW ^= true;
14873
+ Globals.RENDERSHADOW ^= true;
1487014874 Globals.lighttouched = true;
1487114875 repaint();
1487214876 break;
....@@ -14990,7 +14994,7 @@
1499014994 //mode = ROTATE;
1499114995 if ((MODIFIERS & COMMAND) == 0) // VR??
1499214996 {
14993
- SetMouseMode(modifiers);
14997
+ SetMouseMode(0, modifiers);
1499414998 }
1499514999 }
1499615000
....@@ -15563,6 +15567,7 @@
1556315567 public boolean mouseDown(Event evt, int x, int y)
1556415568 {
1556515569 System.out.println("mouseDown: " + evt);
15570
+ System.exit(0);
1556615571 /*
1556715572 locked = true;
1556815573 drag = false;
....@@ -15606,7 +15611,7 @@
1560615611 {
1560715612 keyPressed(0, modifiers);
1560815613 }
15609
- clickStart(x, y, modifiers);
15614
+ // clickStart(x, y, modifiers);
1561015615 return true;
1561115616 }
1561215617
....@@ -15724,7 +15729,7 @@
1572415729 {
1572515730 keyReleased(0, 0);
1572615731 }
15727
- drag(x, y, modifiers);
15732
+ drag(x, y, 0, modifiers);
1572815733 return true;
1572915734 }
1573015735
....@@ -16422,16 +16427,16 @@
1642216427 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]));
1642316428 }
1642416429
16425
- previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);
16430
+ previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint);
1642616431 }
1642716432 }
1642816433
1642916434 if (!movingcamera && !PAINTMODE)
1643016435 object.editWindow.ScreenFitPoint(); // fev 2014
1643116436
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)
1643316438 {
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);
1643516440
1643616441 Object3D group = new Object3D("inst" + paintcount++);
1643716442
....@@ -16587,7 +16592,7 @@
1658716592 gl.glDisable(gl.GL_CULL_FACE);
1658816593 }
1658916594
16590
- if (!RENDERSHADOW)
16595
+ if (!Globals.RENDERSHADOW)
1659116596 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1659216597
1659316598 // SB gl.glPolygonOffset(2.5f, 10);
....@@ -16597,7 +16602,7 @@
1659716602 //gl.glColorMask(false, false, false, false);
1659816603
1659916604 //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())
1660116606 {
1660216607 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1660316608