/** * Appends the tet nabors of the specified node to the specified list. * @param node the node for which to get nabors. * @param nabors the list to which nabors are appended. */ public synchronized void getTetNabors(Node node, TetList nabors) { clearTetMarks(); getTetNabors(node,node._tet,nabors); }
/** * Finds a tet that intersects the specified plane a*x+b*y+c*z+d = 0. * @param a the coefficient a in the equation for the plane. * @param b the coefficient b in the equation for the plane. * @param c the coefficient c in the equation for the plane. * @param d the coefficient d in the equation for the plane. * @return the tet; null if none intersects the plane. */ public Tet findTetInPlane(double a, double b, double c, double d) { Node node = findNodeNearestPlane(a,b,c,d); Tet[] tets = getTetNabors(node); for (Tet tet:tets) { if (tet.intersectsPlane(a,b,c,d)) return tet; } return null; }
/** * Gets an array of tet nabors of the specified face. * @param face the face for which to get nabors. * @return the array of nabors. */ public synchronized Tet[] getTetNabors(Face face) { TetList nabors = new TetList(); getTetNabors(face,nabors); return nabors.trim(); }
/** * Gets an array of tet nabors of the specified node. * @param node the node for which to get nabors. * @return the array of nabors. */ public synchronized Tet[] getTetNabors(Node node) { TetList nabors = new TetList(); getTetNabors(node,nabors); return nabors.trim(); }
/** * Gets an array of tet nabors of the specified edge. * @param edge the edge for which to get nabors. * @return the array of nabors. */ public synchronized Tet[] getTetNabors(Edge edge) { TetList nabors = new TetList(); getTetNabors(edge,nabors); return nabors.trim(); }
if (node==n0) { if (t1!=null && !isMarked(t1)) getTetNabors(node,t1,nabors); if (t2!=null && !isMarked(t2)) getTetNabors(node,t2,nabors); if (t3!=null && !isMarked(t3)) getTetNabors(node,t3,nabors); } else if (node==n1) { if (t3!=null && !isMarked(t3)) getTetNabors(node,t3,nabors); if (t2!=null && !isMarked(t2)) getTetNabors(node,t2,nabors); if (t0!=null && !isMarked(t0)) getTetNabors(node,t0,nabors); } else if (node==n2) { if (t3!=null && !isMarked(t3)) getTetNabors(node,t3,nabors); if (t0!=null && !isMarked(t0)) getTetNabors(node,t0,nabors); if (t1!=null && !isMarked(t1)) getTetNabors(node,t1,nabors); } else if (node==n3) { if (t1!=null && !isMarked(t1)) getTetNabors(node,t1,nabors); if (t0!=null && !isMarked(t0)) getTetNabors(node,t0,nabors); if (t2!=null && !isMarked(t2)) getTetNabors(node,t2,nabors); } else {
/** * Determines whether the specified node is an inner node. * @param node a node. * @return true, if inner; false, otherwise. */ public boolean isInner(Node node) { Tet tet = node.tet(); if (tet==null || isInner(tet)) return true; Tet[] tets = getTetNabors(node); int ntet = tets.length; for (int itet=0; itet<ntet; ++itet) { if (isInner(tets[itet])) return true; } return false; }
getTetNabors(na,nb,tc,nabors); getTetNabors(na,nb,td,nabors);
/** * Appends the tet nabors of the specified edge to the specified list. * @param edge the edge for which to get nabors. * @param nabors the list to which nabors are appended. */ public synchronized void getTetNabors(Edge edge, TetList nabors) { Node na = edge.nodeA(); Node nb = edge.nodeB(); Tet tet = edge.tet(); if (tet==null) tet = findTet(na,nb); if (tet==null) return; clearTetMarks(); getTetNabors(na,nb,tet,nabors); }
Tet[] tets = getTetNabors(node); ArrayList<Tet> tetStack = new ArrayList<Tet>(512); int ntet = tets.length;
/** * Determines whether the specified edge is an inner edge. * @param edge an edge. * @return true, if inner; false, otherwise. */ public boolean isInner(Edge edge) { Tet tet = edge.tet(); if (tet==null) tet = findTet(edge.nodeA(),edge.nodeB()); if (tet==null) return false; if (tet.isInner()) return true; Tet[] tets = getTetNabors(edge); int ntet = tets.length; for (int itet=0; itet<ntet; ++itet) { if (isInner(tets[itet])) return true; } return false; }
tm.addNode(n3); tm.addNode(n4); assertEquals(2,tm.getTetNabors(n0).length); assertEquals(2,tm.getTetNabors(n1).length); assertEquals(2,tm.getTetNabors(n2).length); assertEquals(1,tm.getTetNabors(n3).length); assertEquals(1,tm.getTetNabors(n4).length); assertEquals(2,tm.getTetNabors(tm.findEdge(n0,n1)).length); assertEquals(2,tm.getTetNabors(tm.findEdge(n1,n2)).length); assertEquals(2,tm.getTetNabors(tm.findEdge(n2,n0)).length); assertEquals(1,tm.getTetNabors(tm.findEdge(n0,n3)).length); assertEquals(1,tm.getTetNabors(tm.findEdge(n0,n4)).length); assertEquals(1,tm.getTetNabors(tm.findEdge(n1,n3)).length); assertEquals(1,tm.getTetNabors(tm.findEdge(n1,n4)).length); assertEquals(1,tm.getTetNabors(tm.findEdge(n2,n3)).length); assertEquals(1,tm.getTetNabors(tm.findEdge(n2,n4)).length); assertEquals(2,tm.getTetNabors(tm.findFace(n0,n1,n2)).length); assertEquals(1,tm.getTetNabors(tm.findFace(n0,n2,n3)).length); assertEquals(1,tm.getTetNabors(tm.findFace(n1,n3,n2)).length); assertEquals(1,tm.getTetNabors(tm.findFace(n0,n3,n1)).length); assertEquals(1,tm.getTetNabors(tm.findFace(n0,n4,n2)).length); assertEquals(1,tm.getTetNabors(tm.findFace(n0,n1,n4)).length); assertEquals(1,tm.getTetNabors(tm.findFace(n1,n2,n4)).length); assertEquals(3,tm.getFaceNabors(tm.findEdge(n0,n1)).length); assertEquals(3,tm.getFaceNabors(tm.findEdge(n1,n2)).length);
Tet[] tets = getTetNabors(node); int ntet = tets.length; for (int itet=0; itet<ntet; ++itet) {
Tet[] tets = getTetNabors(node); int ntet = tets.length; clearNodeMarks();