Normand Briere
2019-08-28 547c9203ab5d8e4bee36d1cbb453dfa36bbec4ef
Test has big data.
12 files modified
94 ■■■■ changed files
Camera.java 8 ●●●● patch | view | raw | blame | history
ClickInfo.java 4 ●●●● patch | view | raw | blame | history
ClippedPoly.java 10 ●●●● patch | view | raw | blame | history
ImplicitTiler.java 2 ●●● patch | view | raw | blame | history
MorphEditor.java 4 ●●●● patch | view | raw | blame | history
MorphNode.java 2 ●●● patch | view | raw | blame | history
ObjEditor.java 10 ●●●● patch | view | raw | blame | history
Object3D.java 44 ●●●● patch | view | raw | blame | history
ParticleNode.java 2 ●●● patch | view | raw | blame | history
ParticleSystem.java 2 ●●● patch | view | raw | blame | history
ProgressWindow.java 2 ●●● patch | view | raw | blame | history
mocap/figure/AnimData.java 4 ●●●● patch | view | raw | blame | history
Camera.java
....@@ -52,7 +52,7 @@
5252 perspective = true;
5353 break;
5454 case 1: // '\001'
55
- location = LA.newVector(4, 0, 0);
55
+ location = LA.newVector(0, 0, 4); // Needed for translation direction
5656 perspective = false;
5757 break;
5858 case 2: // '\002'
....@@ -63,7 +63,7 @@
6363 //LA.matXRotate(fromScreen, LA.toRadians(90));
6464 break;
6565 case 3: // '\003'
66
- location = LA.newVector(0, 0, 4);
66
+ location = LA.newVector(4, 0, 0); // Needed for translation direction
6767 //LA.matZRotate(toScreen, LA.toRadians(-90));
6868 //LA.matXRotate(toScreen, LA.toRadians(-90));
6969 //LA.matXRotate(fromScreen, LA.toRadians(90));
....@@ -476,8 +476,8 @@
476476 cVector location;
477477 cVector lookAt;
478478 cVector direction;
479
- double toScreen[][];
480
- double fromScreen[][];
479
+ double[][] toScreen;
480
+ double[][] fromScreen;
481481 boolean perspective;
482482 int hAspect = 0; // Free camera
483483 int vAspect;
ClickInfo.java
....@@ -24,7 +24,7 @@
2424 int flags;
2525 Rectangle bounds;
2626 Camera camera;
27
- double toScreen[][];
27
+ double[][] toScreen;
2828 iCameraPane pane;
2929 Graphics g;
3030 int DX, DY;
....@@ -32,5 +32,5 @@
3232
3333 double scale; // Distance from clicked point to origin
3434
35
- static double matbuffer[][] = new double[4][4];
35
+ static double[][] matbuffer = new double[4][4];
3636 }
ClippedPoly.java
....@@ -11,11 +11,11 @@
1111 {
1212 }
1313
14
- double pv[];
15
- double qv[];
16
- double rv[];
17
- double sv[];
18
- double norm[];
14
+ double[] pv;
15
+ double[] qv;
16
+ double[] rv;
17
+ double[] sv;
18
+ double[] norm;
1919 int nGood;
2020 int nBad;
2121 }
ImplicitTiler.java
....@@ -1367,7 +1367,7 @@
13671367 double cellSize2;
13681368 double tolerance;
13691369 BoundaryRep bRep;
1370
- int nCells[];
1370
+ int[] nCells;
13711371 cVector minima;
13721372 cVector maxima;
13731373 static Vertex[] triangle = new Vertex[4];
MorphEditor.java
....@@ -193,8 +193,8 @@
193193
194194 MorphNode morphnode;
195195
196
- //JLabel morphLabel[];
197
- cNumberSlider morphField[];
196
+ //JLabel[] morphLabel;
197
+ cNumberSlider[] morphField;
198198
199199 ObjectUI parent;
200200
MorphNode.java
....@@ -7,7 +7,7 @@
77 Object3D morphobject;
88
99 // MORPH weights
10
- double morphweights[];
10
+ double[] morphweights;
1111
1212 MorphNode(Object3D object)
1313 {
ObjEditor.java
....@@ -990,6 +990,8 @@
990990 object.ExtractBigData(Grafreed.grafreed.universe.versiontable);
991991 // if (copy == client)
992992
993
+ assert(!object.HasBigData());
994
+
993995 Object3D versions[] = object.versionlist;
994996 java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe
995997 object.versionlist = null;
....@@ -1000,6 +1002,8 @@
10001002
10011003 //byte[] compress = Compress(copy);
10021004 Object3D compress = (Object3D)Grafreed.clone(object);
1005
+
1006
+ assert(!compress.HasBigData());
10031007
10041008 object.parent = parent;
10051009
....@@ -2004,7 +2008,7 @@
20042008
20052009 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
20062010
2007
- frame.setSize(1280, 860);
2011
+ frame.setSize(1280, 900);
20082012
20092013 cameraView.requestFocusInWindow();
20102014
....@@ -4485,7 +4489,7 @@
44854489 public boolean Save(boolean user)
44864490 {
44874491 System.err.println("Save");
4488
- Replace();
4492
+ //Replace();
44894493
44904494 if (copy.versionlist == null)
44914495 {
....@@ -4594,6 +4598,8 @@
45944598 {
45954599 Object3D obj = (Object3D)Grafreed.clone(changed.versionlist[copy.versionindex]);
45964600
4601
+ assert(!obj.HasBigData());
4602
+
45974603 boolean temp = CameraPane.SWITCH;
45984604 CameraPane.SWITCH = false;
45994605
Object3D.java
....@@ -33,7 +33,7 @@
3333 String skyboxname;
3434 String skyboxext;
3535
36
- Object3D versionlist[];
36
+ Object3D[] versionlist;
3737 int versionindex = -1;
3838
3939 java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>();
....@@ -190,8 +190,39 @@
190190 }
191191 }
192192
193
+ boolean HasBigData()
194
+ {
195
+ if (blockloop)
196
+ return false;
197
+
198
+ if (bRep != null)
199
+ {
200
+ return true;
201
+ }
202
+
203
+ blockloop = true;
204
+
205
+ for (int i = 0; i < Size(); i++)
206
+ {
207
+ Object3D child = (Object3D) get(i);
208
+ if (child == null)
209
+ continue;
210
+ if (child.HasBigData())
211
+ {
212
+ blockloop = false;
213
+ return true;
214
+ }
215
+ }
216
+
217
+ blockloop = false;
218
+ return false;
219
+ }
220
+
193221 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
194222 {
223
+ if (blockloop)
224
+ return;
225
+
195226 Object3D o;
196227
197228 boolean isnew = false;
....@@ -215,7 +246,7 @@
215246 hashtable.put(GetUUID(), o);
216247 }
217248
218
- if (!blockloop)
249
+ //if (!blockloop)
219250 {
220251 blockloop = true;
221252
....@@ -227,7 +258,7 @@
227258 blockloop = false;
228259 }
229260
230
- if (isnew)
261
+ //if (isnew)
231262 ExtractBigData(o);
232263 }
233264
....@@ -338,15 +369,15 @@
338369
339370 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
340371 {
372
+ if (blockloop)
373
+ return;
374
+
341375 if (!hashtable.containsKey(GetUUID()))
342376 return;
343377
344378 Object3D o = hashtable.get(GetUUID());
345379
346380 RestoreBigData(o);
347
-
348
- if (blockloop)
349
- return;
350381
351382 blockloop = true;
352383
....@@ -363,6 +394,7 @@
363394 void RestoreBigData(Object3D o)
364395 {
365396 //System.err.println("RestoreBigData : " + this + " <-- " + o);
397
+ Grafreed.Assert(this.bRep == null);
366398
367399 this.bRep = o.bRep;
368400 if (this.support != null && o.transientrep != null)
ParticleNode.java
....@@ -136,7 +136,7 @@
136136 {
137137 return;
138138 }
139
- Vector2f sharedTextureData[];
139
+ Vector2f[] sharedTextureData;
140140
141141 // setup texture coords
142142 switch (getParticleType())
ParticleSystem.java
....@@ -132,7 +132,7 @@
132132 protected Vector3f upVector;
133133 protected Vector3f leftVector;
134134 protected Vector3f invScale;
135
- protected Particle particles[];
135
+ protected Particle[] particles;
136136
137137 // protected Vector3f particleSpeed;
138138 protected int releaseRate; // particles per second
ProgressWindow.java
....@@ -131,7 +131,7 @@
131131
132132 private JFrame frame;
133133 private int numLabels;
134
- private JLabel labels[];
134
+ private JLabel[] labels;
135135 private JProgressBar progressBar;
136136 private static final int INSET = 20;
137137 private static final int SEPARATOR = 5;
mocap/figure/AnimData.java
....@@ -11,10 +11,10 @@
1111 {
1212 static final long serialVersionUID = -2918094393566350403L;
1313
14
- //private double _data2[][]; // first index: bones, second index: frames
14
+ //private double[][] _data2; // first index: bones, second index: frames
1515 //transient
1616 public
17
- float _data[][]; // first index: bones, second index: frames
17
+ float[][] _data; // first index: bones, second index: frames
1818 public
1919 float scale; // may 2014: scale for position
2020 private int _numFrames;