Tet t3 = tet._t3; if (t0==null && leftOfPlane(n1,n2,n3,node)) { _faceSet.add(tet,n0); getDelaunayFacesOutside(node,getNextTetOnHull(tet,n1,n0)); getDelaunayFacesOutside(node,getNextTetOnHull(tet,n2,n0)); _faceSet.add(tet,n1); getDelaunayFacesOutside(node,getNextTetOnHull(tet,n3,n1)); getDelaunayFacesOutside(node,getNextTetOnHull(tet,n2,n1)); _faceSet.add(tet,n2); getDelaunayFacesOutside(node,getNextTetOnHull(tet,n3,n2)); getDelaunayFacesOutside(node,getNextTetOnHull(tet,n0,n2)); _faceSet.add(tet,n3); getDelaunayFacesOutside(node,getNextTetOnHull(tet,n1,n3)); getDelaunayFacesOutside(node,getNextTetOnHull(tet,n0,n3));
/** * Doubles the capacity of the set. */ private void doubleCapacity() { //trace("FaceSet.doubleCapacity"); FaceSet set = new FaceSet(2*_nmax,_factor); if (_n>0) { for (int i=0; i<_nmax; ++i) { if (_filled[i]) set.add(_a[i],_b[i],_c[i],_d[i],_abcd[i]); } } _a = set._a; _b = set._b; _c = set._c; _d = set._d; _abcd = set._abcd; _filled = set._filled; _nmax = set._nmax; _n = set._n; _factor = set._factor; _shift = set._shift; _mask = set._mask; _index = set._index; } }
/** * Adds the mate of the face of the specified tet that is opposite * the specified node, unless the face is in the set, in which case * that face is removed. Sets the current face to the mate added or * the face removed. * @param tet the tet that references the nodes in the face. * @param node the other node in the tet that is not in the face. * @return true, if the mate was added; false, if the face was removed. */ boolean addMate(Tet tet, Node node) { Tet tetNabor = tet.tetNabor(node); Node nodeNabor = (tetNabor!=null)?tet.nodeNabor(tetNabor):null; if (node==tet._n0) { return add(tet._n1,tet._n2,tet._n3,nodeNabor,tetNabor); } else if (node==tet._n1) { return add(tet._n3,tet._n2,tet._n0,nodeNabor,tetNabor); } else if (node==tet._n2) { return add(tet._n3,tet._n0,tet._n1,nodeNabor,tetNabor); } else if (node==tet._n3) { return add(tet._n1,tet._n0,tet._n2,nodeNabor,tetNabor); } else { assert false:"node is referenced by tet"; return false; } }
/** * Adds the face of the specified tet that is opposite the specified node, * unless its mate is in the set, in which case that mate is removed. * Sets the current face to the face added or the mate removed. * @param tet the tet that references nodes in the face. * @param node the other node in the tet that is not in the face. * @return true, if the face was added; false, if the mate was removed. */ boolean add(Tet tet, Node node) { if (node==tet._n0) { return add(tet._n1,tet._n3,tet._n2,node,tet); } else if (node==tet._n1) { return add(tet._n2,tet._n3,tet._n0,node,tet); } else if (node==tet._n2) { return add(tet._n3,tet._n1,tet._n0,node,tet); } else if (node==tet._n3) { return add(tet._n0,tet._n1,tet._n2,node,tet); } else { assert false:"node is referenced by tet"; return false; } }