/** * Returns a new tet, possibly one resurrected from the dead. * Resurrection reduces the need for garbage collection of dead tets. * Assuming that the new tet will be linked into the mesh, the root * tet is set to the new tet. */ private Tet makeTet(Node n0, Node n1, Node n2, Node n3) { ++_ntet; int ndead = _deadTets.ntet(); if (ndead==0) { _troot = new Tet(n0,n1,n2,n3); } else { _troot = _deadTets.remove(ndead-1); _troot.init(n0,n1,n2,n3); } if (_ntetListeners>0) fireTetAdded(_troot); return _troot; }