Normand Briere
2019-05-01 d1e1417edc8a6ccf195b6da3270f22234dda61e4
CameraPane.java
....@@ -56,8 +56,6 @@
5656 static int CURRENTANTIALIAS = 0; // 1;
5757 /*static*/ boolean RENDERSHADOW = true;
5858 /*static*/ int RENDERPROGRAM = 2; // 0 == none, 1 == fast, 2 == normal
59
- static boolean ANIMATION = false;
60
- static String filename;
6159
6260 boolean DISPLAYTEXT = false;
6361 //boolean REDUCETEXTURE = true;
....@@ -92,6 +90,8 @@
9290
9391 static int tickcount = 0; // slow pose issue
9492
93
+static boolean BUTTONLESSWHEEL = false;
94
+static boolean ZOOMBOXMODE = false;
9595 static boolean BOXMODE = false;
9696 static boolean IMAGEFLIP = false;
9797 static boolean SMOOTHFOCUS = false;
....@@ -223,6 +223,11 @@
223223 public boolean IsBoxMode()
224224 {
225225 return BOXMODE;
226
+ }
227
+
228
+ public boolean IsZoomBoxMode()
229
+ {
230
+ return ZOOMBOXMODE;
226231 }
227232
228233 public void ClearDepth()
....@@ -1612,12 +1617,12 @@
16121617 //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
16131618 if (!material.multiply)
16141619 {
1615
- display.color = color;
1620
+ display.color = material.color;
16161621 display.saturation = material.modulation;
16171622 }
16181623 else
16191624 {
1620
- display.color *= color*2;
1625
+ display.color *= material.color*2;
16211626 display.saturation *= material.modulation*2;
16221627 }
16231628
....@@ -2168,6 +2173,11 @@
21682173 public void ToggleBoxMode()
21692174 {
21702175 BOXMODE ^= true;
2176
+ }
2177
+
2178
+ public void ToggleZoomBoxMode()
2179
+ {
2180
+ ZOOMBOXMODE ^= true;
21712181 }
21722182
21732183 public void ToggleSmoothFocus()
....@@ -4196,6 +4206,7 @@
41964206
41974207 com.sun.opengl.util.texture.Texture CompressTexture2(String name)
41984208 {
4209
+ new Exception().printStackTrace();
41994210 System.exit(0);
42004211 com.sun.opengl.util.texture.Texture texture = null;
42014212
....@@ -9382,7 +9393,7 @@
93829393 //gl.glFlush();
93839394 gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE);
93849395
9385
- if (ANIMATION && ABORTED)
9396
+ if (Globals.ANIMATION && ABORTED)
93869397 {
93879398 System.err.println(" ABORTED FRAME");
93889399 break;
....@@ -9412,7 +9423,7 @@
94129423 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
94139424
94149425 // save image
9415
- if (ANIMATION && !ABORTED)
9426
+ if (Globals.ANIMATION && !ABORTED)
94169427 {
94179428 VPwidth = viewport[2];
94189429 VPheight = viewport[3];
....@@ -9523,7 +9534,7 @@
95239534
95249535 // imagecount++;
95259536
9526
- String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
9537
+ String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
95279538
95289539 if (!BOXMODE)
95299540 {
....@@ -11247,8 +11258,14 @@
1124711258 {
1124811259 renderpass++;
1124911260 // System.out.println("Draw object... ");
11261
+ STEP = 1;
1125011262 if (FAST) // in case there is no script
11251
- STEP = 16;
11263
+ STEP = 8;
11264
+
11265
+ if (CURRENTANTIALIAS == 0 || ACSIZE == 1)
11266
+ {
11267
+ STEP *= 4;
11268
+ }
1125211269
1125311270 //object.FullInvariants();
1125411271
....@@ -12735,7 +12752,7 @@
1273512752 "MUL final.y, fragment.texcoord[0].x, c256;" +
1273612753 "FLR final.x, final.y;" +
1273712754 "SUB final.y, final.y, final.x;" +
12738
- "MUL final.x, final.x, c256i;" +
12755
+ //"MUL final.x, final.x, c256i;" +
1273912756 "MOV final.z, zero.x;" +
1274012757 "MOV final.a, one.w;":""
1274112758 ) +
....@@ -12743,7 +12760,7 @@
1274312760 "MUL final.y, fragment.texcoord[0].y, c256;" +
1274412761 "FLR final.x, final.y;" +
1274512762 "SUB final.y, final.y, final.x;" +
12746
- "MUL final.x, final.x, c256i;" +
12763
+ //"MUL final.x, final.x, c256i;" +
1274712764 "MOV final.z, zero.x;" +
1274812765 "MOV final.a, one.w;":""
1274912766 ) +
....@@ -13523,6 +13540,7 @@
1352313540
1352413541 //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio);
1352513542
13543
+ if (BUTTONLESSWHEEL)
1352613544 if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30)
1352713545 {
1352813546 return;
....@@ -13531,7 +13549,7 @@
1353113549 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
1353213550
1353313551 // TIMER
13534
- if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
13552
+ if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
1353513553 {
1353613554 keepboxmode = BOXMODE;
1353713555 keepsupport = SUPPORT;
....@@ -13748,11 +13766,11 @@
1374813766
1374913767 public void mouseDragged(MouseEvent e)
1375013768 {
13769
+ //System.out.println("mouseDragged: " + e);
1375113770 if (isRenderer)
1375213771 movingcamera = true;
1375313772 //if (drawing)
1375413773 //return;
13755
- //System.out.println("mouseDragged: " + e);
1375613774 if ((e.getModifiersEx() & CTRL) != 0
1375713775 || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1375813776 {
....@@ -13933,6 +13951,7 @@
1393313951
1393413952 public void run()
1393513953 {
13954
+ new Exception().printStackTrace();
1393613955 System.exit(0);
1393713956 for (;;)
1393813957 {
....@@ -14287,7 +14306,6 @@
1428714306 public void mouseMoved(MouseEvent e)
1428814307 {
1428914308 //System.out.println("mouseMoved: " + e);
14290
-
1429114309 if (isRenderer)
1429214310 return;
1429314311
....@@ -15100,8 +15118,9 @@
1510015118
1510115119 protected void processMouseMotionEvent(MouseEvent e)
1510215120 {
15103
- //System.out.println("processMouseMotionEvent: " + mouseMode);
15104
- if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15121
+ //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
15122
+ //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15123
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
1510515124 {
1510615125 mouseMoved(e);
1510715126 } else
....@@ -15131,6 +15150,7 @@
1513115150
1513215151 void SelectParent()
1513315152 {
15153
+ new Exception().printStackTrace();
1513415154 System.exit(0);
1513515155 Composite group = (Composite) object;
1513615156 java.util.Vector selectees = new java.util.Vector(group.selection);
....@@ -15154,6 +15174,7 @@
1515415174
1515515175 void SelectChildren()
1515615176 {
15177
+ new Exception().printStackTrace();
1515715178 System.exit(0);
1515815179 /*
1515915180 Composite group = (Composite) object;
....@@ -16267,6 +16288,7 @@
1626716288 {
1626816289 if (!selection)
1626916290 {
16291
+ new Exception().printStackTrace();
1627016292 System.exit(0);
1627116293 return;
1627216294 }