[subproblem creation and recursion moved into function
Andreas Röver <roever@users.sourceforge.net>**20051008175253] {
hunk ./src/lib/disassembler_0.cpp 471
+separation_c * disassembler_0_c::checkSubproblem(int pieceCount, voxel_type * pieces, int piecenumber, node0_c * st, bool left, bool * ok) {
+
+  separation_c * res = 0;
+
+  if (pieceCount == 1) {
+    *ok = true;
+  } else if (subProbGroup(st, pieces, left, piecenumber)) {
+    *ok = true;
+  } else {
+
+    node0_c *n;
+    voxel_type * pn;
+    create_new_params(st, &n, &pn, piecenumber, pieces, pieceCount, left);
+    res = disassemble_rec(pieceCount, pn, n);
+
+    *ok = res || subProbGrouping(pn, pieceCount);
+
+    delete [] pn;
+  }
+
+  return res;
+}
+
+
hunk ./src/lib/disassembler_0.cpp 586
-      if (part1 == 1) {
-        remove_ok = true;
-      } else if (subProbGroup(st, pieces, false, piecenumber)) {
-        remove_ok = true;
-      } else {
-
-        node0_c *n;
-        voxel_type * pn;
-        create_new_params(st, &n, &pn, piecenumber, pieces, part1, false);
-        remove = disassemble_rec(part1, pn, n);
-
-        remove_ok = remove || subProbGrouping(pn, part1);
-
-        delete [] pn;
-      }
+      remove = checkSubproblem(part1, pieces, piecenumber, st, false, &remove_ok);
hunk ./src/lib/disassembler_0.cpp 589
-      if (remove_ok) {
-
-        if (part2 == 1) {
-          left_ok = true;
-        } else if (subProbGroup(st, pieces, true, piecenumber)) {
-          left_ok = true;
-        } else {
-  
-          node0_c *n;
-          voxel_type * pn;
-          create_new_params(st, &n, &pn, piecenumber, pieces, part2, true);
-          left = disassemble_rec(part2, pn, n);
-  
-          left_ok = left || subProbGrouping(pn, part2);
-  
-          delete [] pn;
-        }
-      }
+      if (remove_ok)
+        left = checkSubproblem(part2, pieces, piecenumber, st, true, &left_ok);
hunk ./src/lib/disassembler_0.h 78
+  separation_c * checkSubproblem(int pieceCount, voxel_type * pieces, int piecenumber, node0_c * st, bool left, bool * ok);
}
