/** * 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); }
clearTetMarks(); stackTet(_troot);
/** * Gets an iterator for all faces on the hull of the mesh. * @return the iterator. */ public synchronized FaceIterator getFacesOnHull() { clearTetMarks(); Face face = getFaceOnHull(_troot); final HashSet<Face> faces = new HashSet<Face>(128); getFacesOnHull(face,faces); return new FaceIterator() { private Iterator<Face> i = faces.iterator(); public final boolean hasNext() { return i.hasNext(); } public final Face next() { return i.next(); } }; }
/** * Appends the node 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 getNodeNabors(Node node, NodeList nabors) { Tet tet = node._tet; if (tet==null) return; clearNodeMarks(); clearTetMarks(); getNodeNabors(node,tet,nabors); }
/** * Returns a tet that references the specified nodes. * @param na a node. * @param nb a node. * @return a tet that references the specified nodes; * or null, if a node is not in the mesh or the mesh * has no tets. */ public synchronized Tet findTet(Node na, Node nb) { Tet tet = findTet(na); if (tet!=null) { clearTetMarks(); tet = findTet(tet,na,nb); } return tet; }
/** * Returns a tet that references the specified nodes. * @param na a node. * @param nb a node. * @param nc a node. * @return a tet that references the specified nodes; * or null, if a node is not in the mesh or the mesh * has no tets. */ public synchronized Tet findTet(Node na, Node nb, Node nc) { Tet tet = findTet(na,nb); if (tet!=null) { clearTetMarks(); tet = findTet(tet,na,nb,nc); } return tet; }
/** * Returns a tet that references the specified nodes. * @param na a node. * @param nb a node. * @param nc a node. * @param nd a node. * @return a tet that references the specified nodes; * or null, if a node is not in the mesh or the mesh * has no tets. */ public synchronized Tet findTet(Node na, Node nb, Node nc, Node nd) { Tet tet = findTet(na,nb,nc); if (tet!=null) { clearTetMarks(); tet = findTet(tet,na,nb,nc,nd); } return tet; }
clearTetMarks(); mark(_tnext);
/** * 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); }
/** * Finds the node nearest to the specified plane. */ private Node findNodeNearestPlane(double a, double b, double c, double d) { // First, find the nearest node among the sampled nodes. _nmin = _nroot; _dmin = distanceToPlaneSquared(_nmin,a,b,c,d); for (Node n:_sampledNodes) { double dp = distanceToPlaneSquared(n,a,b,c,d); if (dp<_dmin) { _dmin = dp; _nmin = n; } } // Then, recursively search node nabors to find the nearest node. // Note that we clear the node marks once, so that we never compute // the distance to a node twice, but that we clear the tet marks // *inside* the loop, to ensure that we visit all tet nabors of the // current nearest node. clearNodeMarks(); double dmin; do { clearTetMarks(); dmin = _dmin; findNodeNaborNearestPlane(a,b,c,d,_nmin,_nmin._tet); } while (_dmin<dmin); return _nmin; }
private boolean getNaturalNabors(float x, float y, float z) { _mesh.clearNodeMarks(); _mesh.clearTetMarks(); _nodeList.clear(); _tetList.clear(); TetMesh.PointLocation pl = _mesh.locatePoint(x,y,z); if (pl.isOutside()) return false; addTet(x,y,z,pl.tet()); return true; } private void addTet(double xp, double yp, double zp, TetMesh.Tet tet) {
double dmin; do { clearTetMarks(); dmin = _dmin; findNodeNaborNearest(x,y,z,_nmin,_nmin._tet);
clearTetMarks(); clearNodeMarks();
clearTetMarks(); _faceSet.clear(); if (pl.isInside()) {
clearTetMarks(); clearNodeMarks(); getDelaunayFacesOpposite(node,tet);