From 547c9203ab5d8e4bee36d1cbb453dfa36bbec4ef Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Tue, 27 Aug 2019 23:45:18 -0400
Subject: [PATCH] Test has big data.

---
 ClippedPoly.java           |   10 ++--
 ImplicitTiler.java         |    2 
 ObjEditor.java             |   10 ++++-
 MorphNode.java             |    2 
 MorphEditor.java           |    4 +-
 Camera.java                |    8 ++--
 ParticleNode.java          |    2 
 Object3D.java              |   44 +++++++++++++++++++---
 ProgressWindow.java        |    2 
 ClickInfo.java             |    4 +-
 mocap/figure/AnimData.java |    4 +-
 ParticleSystem.java        |    2 
 12 files changed, 66 insertions(+), 28 deletions(-)

diff --git a/Camera.java b/Camera.java
index ba4af41..63862a2 100644
--- a/Camera.java
+++ b/Camera.java
@@ -52,7 +52,7 @@
             perspective = true;
             break;
         case 1: // '\001'
-            location = LA.newVector(4, 0, 0);
+            location = LA.newVector(0, 0, 4); // Needed for translation direction
             perspective = false;
             break;
         case 2: // '\002'
@@ -63,7 +63,7 @@
             //LA.matXRotate(fromScreen, LA.toRadians(90));
             break;
         case 3: // '\003'
-            location = LA.newVector(0, 0, 4);
+            location = LA.newVector(4, 0, 0); // Needed for translation direction
             //LA.matZRotate(toScreen, LA.toRadians(-90));
             //LA.matXRotate(toScreen, LA.toRadians(-90));
             //LA.matXRotate(fromScreen, LA.toRadians(90));
@@ -476,8 +476,8 @@
     cVector location;
     cVector lookAt;
     cVector direction;
-    double toScreen[][];
-    double fromScreen[][];
+    double[][] toScreen;
+    double[][] fromScreen;
     boolean perspective;
     int hAspect = 0; // Free camera
     int vAspect;
diff --git a/ClickInfo.java b/ClickInfo.java
index 8966a67..74668fd 100644
--- a/ClickInfo.java
+++ b/ClickInfo.java
@@ -24,7 +24,7 @@
     int flags;
     Rectangle bounds;
     Camera camera;
-    double toScreen[][];
+    double[][] toScreen;
     iCameraPane pane;
     Graphics g;
     int DX, DY;
@@ -32,5 +32,5 @@
     
     double scale; // Distance from clicked point to origin
 
-    static double matbuffer[][] = new double[4][4];
+    static double[][] matbuffer = new double[4][4];
 }
diff --git a/ClippedPoly.java b/ClippedPoly.java
index 17d8ed2..b0030f8 100644
--- a/ClippedPoly.java
+++ b/ClippedPoly.java
@@ -11,11 +11,11 @@
     {
     }
 
-    double pv[];
-    double qv[];
-    double rv[];
-    double sv[];
-    double norm[];
+    double[] pv;
+    double[] qv;
+    double[] rv;
+    double[] sv;
+    double[] norm;
     int nGood;
     int nBad;
 }
diff --git a/ImplicitTiler.java b/ImplicitTiler.java
index f476bed..7667534 100644
--- a/ImplicitTiler.java
+++ b/ImplicitTiler.java
@@ -1367,7 +1367,7 @@
     double cellSize2;
     double tolerance;
     BoundaryRep bRep;
-    int nCells[];
+    int[] nCells;
     cVector minima;
     cVector maxima;
     static Vertex[] triangle = new Vertex[4];
diff --git a/MorphEditor.java b/MorphEditor.java
index 2a8c8a9..c36cd09 100644
--- a/MorphEditor.java
+++ b/MorphEditor.java
@@ -193,8 +193,8 @@
 	
     MorphNode morphnode;
     
-    //JLabel morphLabel[];
-    cNumberSlider morphField[];
+    //JLabel[] morphLabel;
+    cNumberSlider[] morphField;
 
 	ObjectUI parent;
 	
diff --git a/MorphNode.java b/MorphNode.java
index 951d394..5d2224f 100644
--- a/MorphNode.java
+++ b/MorphNode.java
@@ -7,7 +7,7 @@
     Object3D morphobject;
     
 // MORPH weights
-    double morphweights[];
+    double[] morphweights;
     
     MorphNode(Object3D object)
     {
diff --git a/ObjEditor.java b/ObjEditor.java
index 5d17d71..b849ed2 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -990,6 +990,8 @@
         object.ExtractBigData(Grafreed.grafreed.universe.versiontable);
         // if (copy == client)
         
+        assert(!object.HasBigData());
+        
         Object3D versions[] = object.versionlist;
         java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe
         object.versionlist = null;
@@ -1000,6 +1002,8 @@
         
         //byte[] compress = Compress(copy);
         Object3D compress = (Object3D)Grafreed.clone(object);
+        
+        assert(!compress.HasBigData());
         
         object.parent = parent;
         
@@ -2004,7 +2008,7 @@
 
 //            aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
 
-        frame.setSize(1280, 860);
+        frame.setSize(1280, 900);
         
                     cameraView.requestFocusInWindow();
                     
@@ -4485,7 +4489,7 @@
     public boolean Save(boolean user)
     {
         System.err.println("Save");
-        Replace();
+        //Replace();
         
         if (copy.versionlist == null)
         {
@@ -4594,6 +4598,8 @@
     {
         Object3D obj = (Object3D)Grafreed.clone(changed.versionlist[copy.versionindex]);
         
+        assert(!obj.HasBigData());
+        
         boolean temp = CameraPane.SWITCH;
         CameraPane.SWITCH = false;
         
diff --git a/Object3D.java b/Object3D.java
index 05d5865..87058be 100644
--- a/Object3D.java
+++ b/Object3D.java
@@ -33,7 +33,7 @@
     String skyboxname;
     String skyboxext;
     
-    Object3D versionlist[];
+    Object3D[] versionlist;
     int versionindex = -1;    
         
     java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>();
@@ -190,8 +190,39 @@
         }
     }
 
+    boolean HasBigData()
+    {
+        if (blockloop)
+            return false;
+
+        if (bRep != null)
+        {
+            return true;
+        }
+        
+        blockloop = true;
+        
+        for (int i = 0; i < Size(); i++)
+        {
+            Object3D child = (Object3D) get(i);
+            if (child == null)
+                continue;
+            if (child.HasBigData())
+            {
+                blockloop = false;
+                return true;
+            }
+        }
+        
+        blockloop = false;
+        return false;
+    }
+
     void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
     {
+        if (blockloop)
+            return;
+
         Object3D o;
         
         boolean isnew = false;
@@ -215,7 +246,7 @@
             hashtable.put(GetUUID(), o);
         }
 
-        if (!blockloop)
+        //if (!blockloop)
         {
             blockloop = true;
 
@@ -227,7 +258,7 @@
             blockloop = false;
         }
 
-        if (isnew)
+        //if (isnew)
             ExtractBigData(o);
     }
 
@@ -338,15 +369,15 @@
 
     void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
     {
+        if (blockloop)
+            return;
+
         if (!hashtable.containsKey(GetUUID()))
             return;
 
         Object3D o = hashtable.get(GetUUID());
 
         RestoreBigData(o);
-
-        if (blockloop)
-            return;
 
         blockloop = true;
 
@@ -363,6 +394,7 @@
     void RestoreBigData(Object3D o)
     {
         //System.err.println("RestoreBigData : " + this + " <-- " + o);
+        Grafreed.Assert(this.bRep == null);
         
         this.bRep = o.bRep;
         if (this.support != null && o.transientrep != null)
diff --git a/ParticleNode.java b/ParticleNode.java
index d7e2b28..ffb1d1f 100644
--- a/ParticleNode.java
+++ b/ParticleNode.java
@@ -136,7 +136,7 @@
         {
             return;
         }
-        Vector2f sharedTextureData[];
+        Vector2f[] sharedTextureData;
 
         // setup texture coords
         switch (getParticleType())
diff --git a/ParticleSystem.java b/ParticleSystem.java
index bce1a74..36c4cd1 100755
--- a/ParticleSystem.java
+++ b/ParticleSystem.java
@@ -132,7 +132,7 @@
     protected Vector3f upVector;
     protected Vector3f leftVector;
     protected Vector3f invScale;
-    protected Particle particles[];
+    protected Particle[] particles;
 
     // protected Vector3f particleSpeed;
     protected int releaseRate; // particles per second
diff --git a/ProgressWindow.java b/ProgressWindow.java
index 3d61598..4cd64c6 100644
--- a/ProgressWindow.java
+++ b/ProgressWindow.java
@@ -131,7 +131,7 @@
 
     private JFrame frame;
     private int numLabels;
-    private JLabel labels[];
+    private JLabel[] labels;
     private JProgressBar progressBar;
     private static final int INSET = 20;
     private static final int SEPARATOR = 5;
diff --git a/mocap/figure/AnimData.java b/mocap/figure/AnimData.java
index ce83de2..c7e5238 100644
--- a/mocap/figure/AnimData.java
+++ b/mocap/figure/AnimData.java
@@ -11,10 +11,10 @@
 {
     static final long serialVersionUID = -2918094393566350403L;
 
-    //private double _data2[][]; // first index: bones, second index: frames
+    //private double[][] _data2; // first index: bones, second index: frames
     //transient
     public
-            float _data[][]; // first index: bones, second index: frames
+            float[][] _data; // first index: bones, second index: frames
     public
             float scale; // may 2014: scale for position
     private int _numFrames;

--
Gitblit v1.6.2