Normand Briere
2019-10-06 4cbc9cc2b4438dd9bb20095d2305be9150cc0071
Count slider
5 files modified
184 ■■■■■ changed files
BoundaryRep.java 7 ●●●● patch | view | raw | blame | history
CameraPane.java 40 ●●●●● patch | view | raw | blame | history
GroupLeaf.java 4 ●●●● patch | view | raw | blame | history
ObjEditor.java 131 ●●●●● patch | view | raw | blame | history
Object3D.java 2 ●●● patch | view | raw | blame | history
BoundaryRep.java
....@@ -8752,7 +8752,12 @@
87528752 public String toString()
87538753 {
87548754 //return "trim = " + trimmed + "; stripped = " + stripified + "; AOdone = " + AOdone + "; colors = " + colors;
8755
- return "trim = " + trimmed + "; stripped = " + stripified + "; colors = " + colors + "; faces = " + (faces!=null?faces.size():null) + "; triangles = " + (triangles!=null?triangles.length:null) + "; indices = " + indices;
8755
+ return "trim = " + trimmed +
8756
+ "; stripped = " + stripified +
8757
+ "; colors = " + colors +
8758
+ "; faces = " + (faces!=null?faces.size():null) +
8759
+ "; triangles = " + (triangles!=null?triangles.length:null) +
8760
+ ((indices==null)?"":"; indices = " + indices.length);
87568761 }
87578762
87588763 boolean trimmed = false;
CameraPane.java
....@@ -15002,6 +15002,9 @@
1500215002
1500315003 void GoDown(int mod)
1500415004 {
15005
+ LA.vecSub(manipCamera.location, manipCamera.lookAt, manipCamera.direction);
15006
+ float scale = (float)manipCamera.direction.length() / 10;
15007
+
1500515008 MODIFIERS |= COMMAND;
1500615009 boolean isVR = (mouseMode&VR)!=0;
1500715010 /**/
....@@ -15011,16 +15014,16 @@
1501115014 // manipCamera.RotateInterest(0, speed);
1501215015 // else
1501315016 if (isVR)
15014
- ViewAngle(-speed*delta);
15017
+ ViewAngle(-speed*delta*scale);
1501515018 else
15016
- manipCamera.Translate(0, -speed*delta, getWidth());
15019
+ manipCamera.Translate(0, -speed*delta*scale, getWidth());
1501715020 }
1501815021 else
1501915022 {
1502015023 if (isVR)
15021
- manipCamera.BackForth(0, -speed*delta, isVR?1000:0); // getWidth());
15024
+ manipCamera.BackForth(0, -speed*delta*scale, isVR?1000:0); // getWidth());
1502215025 else
15023
- manipCamera.RotatePosition(0, -speed);
15026
+ manipCamera.RotatePosition(0, -speed*scale);
1502415027 }
1502515028
1502615029 /**/
....@@ -15040,6 +15043,9 @@
1504015043
1504115044 void GoUp(int mod)
1504215045 {
15046
+ LA.vecSub(manipCamera.location, manipCamera.lookAt, manipCamera.direction);
15047
+ float scale = (float)manipCamera.direction.length() / 10;
15048
+
1504315049 RigidBody.justclicked = true;
1504415050
1504515051 MODIFIERS |= COMMAND;
....@@ -15052,14 +15058,14 @@
1505215058 // manipCamera.RotateInterest(0, -speed);
1505315059 // else
1505415060 if (isVR)
15055
- ViewAngle(speed*delta);
15061
+ ViewAngle(speed*delta*scale);
1505615062 else
15057
- manipCamera.Translate(0, speed*delta, getWidth());
15063
+ manipCamera.Translate(0, speed*delta*scale, getWidth());
1505815064 }
1505915065 else
1506015066 {
1506115067 if (isVR)
15062
- manipCamera.BackForth(0, speed*delta, isVR?1000:0); // getWidth());
15068
+ manipCamera.BackForth(0, speed*delta*scale, isVR?1000:0); // getWidth());
1506315069 else
1506415070 manipCamera.RotatePosition(0, speed);
1506515071 }
....@@ -15081,16 +15087,19 @@
1508115087
1508215088 void GoLeft(int mod)
1508315089 {
15090
+ LA.vecSub(manipCamera.location, manipCamera.lookAt, manipCamera.direction);
15091
+ float scale = (float)manipCamera.direction.length() / 10;
15092
+
1508415093 MODIFIERS |= COMMAND;
1508515094 /**/
1508615095 if((mod&SHIFT) == SHIFT)
15087
- manipCamera.Translate(speed, 0, getWidth());
15096
+ manipCamera.Translate(speed*scale, 0, getWidth());
1508815097 else
1508915098 {
1509015099 if ((mouseMode&VR)!=0)
15091
- manipCamera.RotateInterest(-speed*manipCamera.shaper_fovy/90, 0);
15100
+ manipCamera.RotateInterest(-speed*scale*manipCamera.shaper_fovy/90, 0);
1509215101 else
15093
- manipCamera.RotatePosition(speed*manipCamera.shaper_fovy/90, 0);
15102
+ manipCamera.RotatePosition(speed*scale*manipCamera.shaper_fovy/90, 0);
1509415103 }
1509515104
1509615105 /**/
....@@ -15113,16 +15122,19 @@
1511315122
1511415123 void GoRight(int mod)
1511515124 {
15125
+ LA.vecSub(manipCamera.location, manipCamera.lookAt, manipCamera.direction);
15126
+ float scale = (float)manipCamera.direction.length() / 10;
15127
+
1511615128 MODIFIERS |= COMMAND;
1511715129 /**/
1511815130 if((mod&SHIFT) == SHIFT)
15119
- manipCamera.Translate(-speed, 0, getWidth());
15131
+ manipCamera.Translate(-speed*scale, 0, getWidth());
1512015132 else
1512115133 {
1512215134 if ((mouseMode&VR)!=0)
15123
- manipCamera.RotateInterest(speed*manipCamera.shaper_fovy/90, 0);
15135
+ manipCamera.RotateInterest(speed*scale*manipCamera.shaper_fovy/90, 0);
1512415136 else
15125
- manipCamera.RotatePosition(-speed*manipCamera.shaper_fovy/90, 0);
15137
+ manipCamera.RotatePosition(-speed*scale*manipCamera.shaper_fovy/90, 0);
1512615138 }
1512715139
1512815140 /**/
....@@ -18275,7 +18287,7 @@
1827518287
1827618288 private boolean keepshadow;
1827718289
18278
- static public boolean capsLocked = false; // VR
18290
+ static public boolean capsLocked = true; // false; // VR
1827918291
1828018292 static public int indexcount = 0;
1828118293 /*static*/ cColor vertexOcclusion = new cColor();
GroupLeaf.java
....@@ -40,8 +40,8 @@
4040 {
4141 ////GraphreeD.trace("SIZE " + count + this + " = ", super.size() - 1);
4242
43
- if (count == 2)
44
- return 2;
43
+ if (count == 1) // 2)
44
+ return 1; // 2;
4545
4646 if (true)
4747 return super.size() - 1; // ???
ObjEditor.java
....@@ -330,6 +330,8 @@
330330 objEditor.ctrlPanel.remove(pushPanel);
331331 if (versionPanel != null)
332332 objEditor.ctrlPanel.remove(versionPanel);
333
+ if (countPanel != null)
334
+ objEditor.ctrlPanel.remove(countPanel);
333335 //objEditor.ctrlPanel.remove(fillPanel);
334336
335337 //Remove(normalpushField);
....@@ -727,53 +729,10 @@
727729 si.SendInfo("#children = " + sel.Size(), "regular");
728730 }
729731 si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
730
- if (debug)
731
- {
732
- try
733
- {
734
- sel.getBounds(minima, maxima, true);
735
- } catch (Exception e)
736
- {
737
- e.printStackTrace();
738
- }
739
-
740
- if (full)
741
- {
742
- si.SendInfo(" BBox min: " + minima, "regular");
743
- si.SendInfo(" BBox max: " + maxima, "regular");
744
- }
745
-
746
- if (sel.bRep != null)
747
- {
748
- si.SendInfo(" BRep: " + sel.bRep.hashCode(), "regular");
749
- si.SendInfo(" Geo: " + sel.bRep.FaceCount() + " triangles, " + sel.bRep.VertexCount()
750
- + " vertices; ", "regular");
751
- si.SendInfo(" Storage: " + sel.bRep, "regular");
752
- si.SendInfo(" Display list: " + sel.bRep.displaylist, "regular");
753
- if (sel.bRep.vertextable != null)
754
- {
755
- si.SendInfo(" ... has vertextable. ", "regular");
756
- }
757
- if (sel.bRep.support != null)
758
- {
759
- si.SendInfo(" bRep support: " + sel.bRep.support, "regular");
760
- }
761
- }
762
- if (sel.transientrep != null)
763
- {
764
- si.SendInfo(" transientrep: " + sel.transientrep.hashCode(), "regular");
765
- si.SendInfo(" Geo: " + sel.transientrep.FaceCount() + " triangles;" + sel.transientrep.VertexCount()
766
- + " vertices; ", "regular");
767
- si.SendInfo(" Storage: " + sel.transientrep, "regular");
768
- }
769
- if (sel.support != null)
770
- {
771
- si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
772
- }
773
- if (sel.scriptnode != null)
774
- {
775
- si.SendInfo(" script: " + sel.scriptnode.scripttext, "regular");
776
- }
732
+ si.SendInfo((debug ? " Complete path: " : " ") + sel.GetPath(), "regular");
733
+ si.SendInfo((debug ? " Texture: " : " ") + sel.GetTextures(), "bold");
734
+ if (sel.GetTextures().pigmentdata != null)
735
+ si.SendInfo(" EMBEDDED ", "regular");
777736 if (sel.toParent != null)
778737 {
779738 sel.GlobalTransformInv();
....@@ -802,11 +761,58 @@
802761 si.SendInfo(" Max count: " + sel.maxcount, "regular");
803762 // SendInfo(" countdown: " + sel.countdown + newline, "regular");
804763 // SendInfo(" delay: " + sel.delay + newline, "regular");
764
+ if (debug)
765
+ {
766
+ try
767
+ {
768
+ sel.getBounds(minima, maxima, true);
769
+ } catch (Exception e)
770
+ {
771
+ e.printStackTrace();
772
+ }
773
+
774
+ if (full)
775
+ {
776
+ si.SendInfo(" BBox min: " + minima, "regular");
777
+ si.SendInfo(" BBox max: " + maxima, "regular");
778
+ }
779
+
780
+ if (sel.bRep != null)
781
+ {
782
+ si.SendInfo(" Mesh: " + sel.bRep.hashCode(), "regular");
783
+ si.SendInfo(" Size: " + sel.bRep.FaceCount() + " triangles, " + sel.bRep.VertexCount()
784
+ + " vertices; ", "regular");
785
+ si.SendInfo(" Storage: " + sel.bRep, "regular");
786
+ if (Globals.ADVANCED)
787
+ {
788
+ si.SendInfo(" Display list: " + sel.bRep.displaylist, "regular");
789
+ if (sel.bRep.vertextable != null)
790
+ {
791
+ si.SendInfo(" ... has vertextable. ", "regular");
792
+ }
793
+ }
794
+ if (sel.bRep.support != null)
795
+ {
796
+ si.SendInfo(" Mesh support: " + sel.bRep.hashCode() + " " + sel.bRep.support, "regular");
797
+ }
798
+ }
799
+ if (sel.transientrep != null)
800
+ {
801
+ si.SendInfo(" transient mesh: " + sel.transientrep.hashCode(), "regular");
802
+ si.SendInfo(" Size: " + sel.transientrep.FaceCount() + " triangles;" + sel.transientrep.VertexCount()
803
+ + " vertices; ", "regular");
804
+ si.SendInfo(" Storage: " + sel.transientrep, "regular");
805
+ }
806
+ if (sel.support != null)
807
+ {
808
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
809
+ }
810
+ if (sel.scriptnode != null)
811
+ {
812
+ si.SendInfo(" script: " + sel.scriptnode.scripttext, "regular");
813
+ }
805814 // live, hide, ...
806815 //?? SendInfo(" Orig: " + maxima + newline, "regular");
807
- if (sel.GetTextures().pigmentdata != null)
808
- si.SendInfo(" EMBEDDED ", "regular");
809
- si.SendInfo((debug ? " Texture: " : " ") + sel.GetTextures(), "bold");
810816 // SendInfo((debug ? " Material: " : " ") + sel.material + newline, "regular");
811817 if (sel instanceof cMesh)
812818 {
....@@ -838,8 +844,6 @@
838844 SwitchNode sn = (SwitchNode) sel;
839845 si.SendInfo(" Switch Object: " + sn.switchobject, "regular");
840846 }
841
-
842
- si.SendInfo((debug ? " Path: " : " ") + sel.GetPath(), "regular");
843847
844848 // System.err.println("info : " + sel.GetPath());
845849 if (sel instanceof PointFlow)
....@@ -1210,8 +1214,11 @@
12101214 cGridBag objectCommandsPanel;
12111215 cGridBag pushPanel;
12121216 cGridBag versionPanel;
1217
+ cGridBag countPanel;
12131218 cGridBag fillPanel;
12141219
1220
+ cNumberSlider countField;
1221
+
12151222 JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
12161223 {
12171224 JCheckBox cb;
....@@ -1466,6 +1473,12 @@
14661473
14671474 pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH * 100, 1.1); // To have the buttons
14681475 normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1476
+ if (copy instanceof Composite && !(copy instanceof cGroup))
1477
+ {
1478
+ oe.ctrlPanel.Return();
1479
+ countPanel = AddSlider(oe.ctrlPanel, "Count", 0, 50, copy.count);
1480
+ countField = (cNumberSlider)countPanel.getComponent(1);
1481
+ }
14691482 if (false && copy.versionlist != null && copy.versionindex != -1)
14701483 {
14711484 oe.ctrlPanel.Return();
....@@ -2244,7 +2257,7 @@
22442257 {
22452258 objectTabbedPane.add(infoPanel);
22462259 objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/info.png"));
2247
- objectTabbedPane.setToolTipTextAt(objectTabCount++, "Information");
2260
+ objectTabbedPane.setToolTipTextAt(objectTabCount++, "Information (advanced)");
22482261 }
22492262
22502263 /*
....@@ -5526,8 +5539,8 @@
55265539 //copy.Touch();
55275540 }
55285541
5529
- cNumberSlider versionSlider;
5530
- cNumberSlider versionField;
5542
+ cNumberSlider versionSlider; // Main
5543
+ cNumberSlider versionField; // selection (off)
55315544
55325545 cNumberSlider scaleSlider;
55335546
....@@ -5573,6 +5586,14 @@
55735586 return;
55745587 }
55755588
5589
+ if (e.getSource() == countField)
5590
+ {
5591
+ copy.count = countField.getInteger();
5592
+ Globals.lighttouched = true;
5593
+ objEditor.refreshContents();
5594
+ return;
5595
+ }
5596
+
55765597 if (e.getSource() == scaleSlider)
55775598 {
55785599 int scale = scaleSlider.getInteger();
Object3D.java
....@@ -3421,7 +3421,7 @@
34213421 }
34223422 }
34233423
3424
- public void Scale(int scale)
3424
+ public void Scale(float scale)
34253425 {
34263426 Object3D obj = this;
34273427