From 078d75406ca983141627d87da5a49bd29abe4023 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Fri, 06 Sep 2019 17:52:08 -0400
Subject: [PATCH] FileObject big data.

---
 FileObject.java  |   16 ++++++++++++++++
 ObjEditor.java   |    2 ++
 BoundaryRep.java |    3 +++
 CameraPane.java  |    4 ++--
 Object3D.java    |    8 +++++++-
 BoxEditor.java   |    4 ++--
 6 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/BoundaryRep.java b/BoundaryRep.java
index 3d93ef4..26fd616 100644
--- a/BoundaryRep.java
+++ b/BoundaryRep.java
@@ -3837,6 +3837,9 @@
             if (n == null)
                 continue;
             
+            if (v.norm == null)
+                v.norm = new cVector();
+            
             LA.vecCopy(n, v.norm);
             
             this.SetVertex(v, i);
diff --git a/BoxEditor.java b/BoxEditor.java
index 7a9962b..4125fc5 100644
--- a/BoxEditor.java
+++ b/BoxEditor.java
@@ -72,7 +72,7 @@
 	{
             super.SetupUI2(oe);
             
-            oe.ctrlPanel.add(optionCB = new JCheckBox("Close Surface", box.open)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
+            oe.ctrlPanel.add(optionCB = new JCheckBox("Close Surface", !box.open)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
             optionCB.addItemListener(this);
             oe.ctrlPanel.Return();
         }
@@ -82,7 +82,7 @@
 		if (//e.getSource() == nameField ||
         	    e.getSource() == optionCB)
 		{
-                    box.open = (e.getStateChange() == ItemEvent.SELECTED);
+                    box.open = (e.getStateChange() != ItemEvent.SELECTED);
                     
                     applySelf();
                     
diff --git a/CameraPane.java b/CameraPane.java
index 7ca1c65..706f7ec 100644
--- a/CameraPane.java
+++ b/CameraPane.java
@@ -174,7 +174,7 @@
     boolean Udebug = false;
     boolean Vdebug = false;
     boolean NORMALdebug = false;
-    static boolean doublesided = false; // true; // reversed normals are awful for conformance
+    static boolean doublesided = true; // false; // reversed normals are awful for conformance
     boolean anisotropy = true;
     boolean softshadow = true; // slower but better false;
     boolean opacityhalo = false; // reverse the halo effect (e.g. glass)
@@ -14830,7 +14830,7 @@
         }
     PingThread pingthread = new PingThread();
     int delta = 2;
-    int speed = 5;
+    int speed = 2;
     boolean autorepeat = false;
 
     void GoDown(int mod)
diff --git a/FileObject.java b/FileObject.java
index e7042e6..b87554b 100644
--- a/FileObject.java
+++ b/FileObject.java
@@ -94,6 +94,22 @@
         this.objfile = objfile;
     }
     
+    void ExtractBigData(Object3D o)
+    {
+        super.ExtractBigData(o);
+        
+        o.savefilecontent = this.filecontent;
+        
+        // filecontent transient
+    }
+
+    void RestoreBigData(Object3D o)
+    {
+        super.RestoreBigData(o);
+        
+        this.filecontent = o.savefilecontent;
+    }
+    
     Object3D deepCopy()
     {
         FileObject e = new FileObject(name, objfile);
diff --git a/ObjEditor.java b/ObjEditor.java
index eb9a304..3fc15f7 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -6010,6 +6010,8 @@
         
             //? SetUndoStates();
             
+            cameraView.RevertCamera();
+            
             ResetModel();
             copy.HardTouch(); // recompile?
             refreshContents();
diff --git a/Object3D.java b/Object3D.java
index 2af64dd..a786677 100644
--- a/Object3D.java
+++ b/Object3D.java
@@ -25,9 +25,12 @@
     // Use GetUUID for backward compatibility with null.
     private UUID uuid = UUID.randomUUID();
     
-    // TEMPORARY for mocap undo. No need to be transient.
+    // TEMPORARY for versions. No need to be transient.
     mocap.reader.BVHReader.BVHResult savebvh;
     Object3D saveskeleton;
+    
+    // FileObject
+    Object3D savefilecontent;
     //
     
     String skyboxname;
@@ -3263,7 +3266,10 @@
     {
         if (bRep != null)
         {
+            //bRep.GenerateNormals2(crease); // in-place doesn't work. it gives wrong normals (diamond artifact).
             bRep.GenerateNormals(crease);
+            if (!bRep.trimmed)
+                bRep.MergeNormals();
             Touch();
         }
     }

--
Gitblit v1.6.2