Normand Briere
2019-06-16 372b7fd481a476cd659713a4a01bf28bf6760cbe
Fix info panel.
3 files modified
84 ■■■■■ changed files
CameraPane.java 35 ●●●●● patch | view | raw | blame | history
GroupEditor.java 32 ●●●● patch | view | raw | blame | history
Object3D.java 17 ●●●● patch | view | raw | blame | history
CameraPane.java
....@@ -1890,7 +1890,7 @@
18901890 void PushMatrix(double[][] matrix)
18911891 {
18921892 // GrafreeD.tracein(matrix);
1893
- PushMatrix(matrix,1);
1893
+ PushMatrix(matrix, 1);
18941894 }
18951895
18961896 void PushMatrix()
....@@ -9335,7 +9335,7 @@
93359335
93369336 if (renderCamera != lightCamera)
93379337 //for (int count = parentcam.GetTransformCount(); --count>=0;)
9338
- LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix);
9338
+ LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
93399339
93409340 // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix);
93419341
....@@ -9351,7 +9351,7 @@
93519351
93529352 if (renderCamera != lightCamera)
93539353 //for (int count = parentcam.GetTransformCount(); --count>=0;)
9354
- LA.matConcat(parentcam.GlobalTransform(), matrix, matrix);
9354
+ LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
93559355
93569356 // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix);
93579357
....@@ -10550,7 +10550,7 @@
1055010550 // if (parentcam != renderCamera) // not a light
1055110551 if (cam != lightCamera)
1055210552 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10553
- LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix);
10553
+ LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
1055410554
1055510555 for (int j = 0; j < 4; j++)
1055610556 {
....@@ -10565,7 +10565,7 @@
1056510565 // if (parentcam != renderCamera) // not a light
1056610566 if (cam != lightCamera)
1056710567 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10568
- LA.matConcat(parentcam.GlobalTransform(), matrix, matrix);
10568
+ LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
1056910569
1057010570 //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix);
1057110571
....@@ -10959,7 +10959,7 @@
1095910959
1096010960 // if (cam != lightCamera)
1096110961 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10962
- LA.xformDir(lightposition, parentcam.GlobalTransformInv(), lightposition); // may 2013
10962
+ LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013
1096310963 }
1096410964
1096510965 LA.xformDir(lightposition, cam.toScreen, lightposition);
....@@ -10981,7 +10981,7 @@
1098110981 {
1098210982 if (cam != lightCamera)
1098310983 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10984
- LA.xformDir(light0, parentcam.GlobalTransformInv(), light0); // may 2013
10984
+ LA.xformDir(light0, parentcam.GlobalTransform(), light0); // may 2013
1098510985 }
1098610986
1098710987 LA.xformPos(light0, cam.toScreen, light0);
....@@ -11894,7 +11894,7 @@
1189411894 for (int i = tp.size(); --i >= 0;)
1189511895 {
1189611896 //for (int count = tp.get(i).GetTransformCount(); --count>=0;)
11897
- LA.xformPos(light, tp.get(i).GlobalTransformInv(), light);
11897
+ LA.xformPos(light, tp.get(i).GlobalTransform(), light);
1189811898 }
1189911899
1190011900
....@@ -11912,7 +11912,7 @@
1191211912 }
1191311913
1191411914 //for (int count = parentcam.GetTransformCount(); --count>=0;)
11915
- LA.xformPos(light, parentcam.GlobalTransformInv(), light); // may 2013
11915
+ LA.xformPos(light, parentcam.GlobalTransform(), light); // may 2013
1191611916
1191711917 LA.xformPos(light, renderCamera.toScreen, light);
1191811918
....@@ -13833,6 +13833,8 @@
1383313833
1383413834 public void mouseDragged(MouseEvent e)
1383513835 {
13836
+ Globals.MOUSEDRAGGED = true;
13837
+
1383613838 //System.out.println("mouseDragged: " + e);
1383713839 if (isRenderer)
1383813840 movingcamera = true;
....@@ -14398,6 +14400,8 @@
1439814400
1439914401 public void mouseReleased(MouseEvent e)
1440014402 {
14403
+ Globals.MOUSEDRAGGED = false;
14404
+
1440114405 movingcamera = false;
1440214406 X = Y = 0;
1440314407 //System.out.println("mouseReleased: " + e);
....@@ -15513,12 +15517,17 @@
1551315517 {
1551415518 switch (object.selection.get(0).hitSomething)
1551515519 {
15516
- case Object3D.hitCenter: gr.setColor(Color.pink); break;
15517
- case Object3D.hitRotate: gr.setColor(Color.green); break;
15518
- case Object3D.hitScale: gr.setColor(Color.cyan); break;
15520
+ case Object3D.hitCenter: gr.setColor(Color.pink);
15521
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15522
+ break;
15523
+ case Object3D.hitRotate: gr.setColor(Color.yellow);
15524
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15525
+ break;
15526
+ case Object3D.hitScale: gr.setColor(Color.cyan);
15527
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15528
+ break;
1551915529 }
1552015530
15521
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1552215531 }
1552315532 }
1552415533 }
GroupEditor.java
....@@ -871,6 +871,7 @@
871871 } else if(e.getSource() == liveCB)
872872 {
873873 cameraView.ToggleLive();
874
+ refreshContents(false);
874875 }
875876 else if(e.getSource() == supportCB)
876877 {
....@@ -1278,7 +1279,7 @@
12781279 memoryItem.addActionListener(this);
12791280 menu.add(analyzeItem = new MenuItem("Analyze"));
12801281 analyzeItem.addActionListener(this);
1281
- menu.add(dumpItem = new MenuItem("Dump"));
1282
+ menu.add(dumpItem = new MenuItem("Print"));
12821283 dumpItem.addActionListener(this);
12831284 // menu.add(pathItem = new MenuItem("From-to path"));
12841285 // pathItem.addActionListener(this);
....@@ -4320,7 +4321,6 @@
43204321 //case 702: // Event.LIST_DESELECT
43214322 group.deselectAll();
43224323 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4323
- objEditor.ClearInfo(); // .GetMaterial());
43244324 if (tps != null)
43254325 {
43264326 for (int i=0; i < tps.length; i++)
....@@ -4330,9 +4330,6 @@
43304330 //if (child.parent != null)
43314331 //child.parent.addSelectee(child);
43324332 group.addSelectee(child);
4333
- objEditor.SetMaterial(child); // .GetMaterial());
4334
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4335
- System.err.println("info : " + child.GetPath());
43364333 }
43374334 }
43384335 // else
....@@ -4342,8 +4339,6 @@
43424339 // System.err.println("info : " + group.GetPath());
43434340 // }
43444341
4345
- objEditor.SetText(); // jan 2014
4346
-
43474342 if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43484343 CameraPane.flash = true;
43494344
....@@ -4367,6 +4362,29 @@
43674362
43684363 freezemodel = false;
43694364 }
4365
+
4366
+ void refreshContents(boolean cp)
4367
+ {
4368
+ if (!Globals.MOUSEDRAGGED)
4369
+ {
4370
+ objEditor.ClearInfo(); // .GetMaterial());
4371
+
4372
+ for (int i=0; i < group.selection.size(); i++)
4373
+ {
4374
+ Object3D child = (Object3D) group.selection.reserve(i);
4375
+
4376
+ objEditor.SetMaterial(child);
4377
+ objEditor.AddInfo(child, this, true);
4378
+ System.err.println("info : " + child.GetPath());
4379
+
4380
+ group.selection.release(i);
4381
+ }
4382
+
4383
+ objEditor.SetText(); // jan 2014
4384
+ }
4385
+
4386
+ super.refreshContents(cp);
4387
+ }
43704388
43714389 void linkSomething(Object3D thing)
43724390 {
Object3D.java
....@@ -7102,7 +7102,7 @@
71027102 spot.translate(32, 32);
71037103 spotw = spot.x + spot.width;
71047104 spoth = spot.y + spot.height;
7105
- info.g.setColor(Color.blue);
7105
+ info.g.setColor(Color.cyan);
71067106 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
71077107 // if (CameraPane.Xmin > spot.x)
71087108 // {
....@@ -7120,11 +7120,12 @@
71207120 // {
71217121 // CameraPane.Ymax = spoth;
71227122 // }
7123
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7124
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7123
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7124
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
71257125 spot.translate(0, -32);
7126
- info.g.setColor(Color.green);
7126
+ info.g.setColor(Color.yellow);
71277127 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7128
+ info.g.setColor(Color.green);
71287129 // if (CameraPane.Xmin > spot.x)
71297130 // {
71307131 // CameraPane.Xmin = spot.x;
....@@ -7442,19 +7443,19 @@
74427443 switch (info.pane.RenderCamera().viewCode)
74437444 {
74447445 case 3: // '\001'
7445
- if (modified)
7446
+ if (modified || opposite)
74467447 {
74477448 //LA.matScale(toParent, 1, hScale, vScale);
74487449 LA.matScale(toParent, totalScale, 1, 1);
74497450 } // vScale, 1);
74507451 else
74517452 {
7452
- LA.matScale(toParent, totalScale, totalScale, totalScale);
7453
+ LA.matScale(toParent, 1, totalScale, totalScale);
74537454 } // vScale, 1);
74547455 break;
74557456
74567457 case 2: // '\002'
7457
- if (modified)
7458
+ if (modified || opposite)
74587459 {
74597460 //LA.matScale(toParent, hScale, 1, vScale);
74607461 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7465,7 +7466,7 @@
74657466 break;
74667467
74677468 case 1: // '\003'
7468
- if (modified)
7469
+ if (modified || opposite)
74697470 {
74707471 //LA.matScale(toParent, hScale, vScale, 1);
74717472 LA.matScale(toParent, 1, 1, totalScale);