commit 9cae4322a55f91b4c2f274102691d9778935b0d2
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed May 1 00:25:52 2019 +0100

    Some simplifications to the Node.

diff --git a/src/main/java/org/distorted/library/main/DistortedNode.java b/src/main/java/org/distorted/library/main/DistortedNode.java
index 14d1abc..0d6b654 100644
--- a/src/main/java/org/distorted/library/main/DistortedNode.java
+++ b/src/main/java/org/distorted/library/main/DistortedNode.java
@@ -77,10 +77,11 @@ public class DistortedNode implements DistortedMaster.Slave
 
   private class NodeData
     {
-    long ID;
+    final long ID;
+    final ArrayList<Long> key;
+
     int numPointingNodes;
     long currTime;
-    ArrayList<Long> key;
     DistortedFramebuffer mFBO;
 
     NodeData(long id, ArrayList<Long> k)
@@ -199,9 +200,8 @@ public class DistortedNode implements DistortedMaster.Slave
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-// tree isomorphism algorithm
 
-  private void adjustIsomorphism()
+  private NodeData retData()
     {
     ArrayList<Long> newList = generateIDList();
     NodeData newData = mMapNodeID.get(newList);
@@ -216,6 +216,15 @@ public class DistortedNode implements DistortedMaster.Slave
       mMapNodeID.put(newList,newData);
       }
 
+    return newData;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// tree isomorphism algorithm
+
+  private void adjustIsomorphism()
+    {
+    NodeData newData = retData();
     boolean deleteOldFBO = false;
     boolean createNewFBO = false;
 
@@ -238,12 +247,10 @@ public class DistortedNode implements DistortedMaster.Slave
     if( deleteOldFBO && createNewFBO )
       {
       newData.mFBO = mData.mFBO;  // just copy over
-      //android.util.Log.d("NODE", "copying over FBOs "+mData.mFBO.getID() );
       }
     else if( deleteOldFBO )
       {
       mData.mFBO.markForDeletion();
-      //android.util.Log.d("NODE", "deleting old FBO "+mData.mFBO.getID() );
       mData.mFBO = null;
       }
     else if( createNewFBO )
@@ -251,7 +258,6 @@ public class DistortedNode implements DistortedMaster.Slave
       int width  = mFboW <= 0 ? mSurface.getWidth()  : mFboW;
       int height = mFboH <= 0 ? mSurface.getHeight() : mFboH;
       newData.mFBO = new DistortedFramebuffer(1,mFboDepthStencil, DistortedSurface.TYPE_TREE, width, height);
-      //android.util.Log.d("NODE", "creating new FBO "+newData.mFBO.getID() );
       }
 
     mData = newData;
@@ -399,7 +405,6 @@ public class DistortedNode implements DistortedMaster.Slave
     mState         = new DistortedRenderState();
     mChildren      = null;
     mNumChildren   = new int[1];
-    mNumChildren[0]= 0;
     mParent        = null;
     mSurfaceParent = null;
     mRenderWayOIT  = false;
@@ -408,22 +413,7 @@ public class DistortedNode implements DistortedMaster.Slave
     mFboH            = 0;  // mSurface's dimensions
     mFboDepthStencil = DistortedFramebuffer.DEPTH_NO_STENCIL;
 
-    ArrayList<Long> list = new ArrayList<>();
-    list.add(mSurface.getID());
-    list.add(-mEffects.getID());
-
-    mData = mMapNodeID.get(list);
-   
-    if( mData!=null )
-      {
-      mData.numPointingNodes++;
-      }
-    else
-      {
-      mData = new NodeData(++mNextNodeID,list);
-      mMapNodeID.put(list, mData);
-      }
-
+    mData = retData();
     mEffects.newNode(this);
     }
 
@@ -490,23 +480,9 @@ public class DistortedNode implements DistortedMaster.Slave
       {
       mChildren = null;
       mNumChildren = new int[1];
-      mNumChildren[0] = 0;
-      }
-   
-    ArrayList<Long> list = generateIDList();
-   
-    mData = mMapNodeID.get(list);
-   
-    if( mData!=null )
-      {
-      mData.numPointingNodes++;
-      }
-    else
-      {
-      mData = new NodeData(++mNextNodeID,list);
-      mMapNodeID.put(list, mData);
       }
 
+    mData = retData();
     mEffects.newNode(this);
     }
 
