org.locationtech.jts.triangulate.quadedge.QuadEdgeSubdivision.visitTriangles()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(53)

本文整理了Java中org.locationtech.jts.triangulate.quadedge.QuadEdgeSubdivision.visitTriangles方法的一些代码示例,展示了QuadEdgeSubdivision.visitTriangles的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QuadEdgeSubdivision.visitTriangles方法的具体详情如下:
包路径:org.locationtech.jts.triangulate.quadedge.QuadEdgeSubdivision
类名称:QuadEdgeSubdivision
方法名:visitTriangles

QuadEdgeSubdivision.visitTriangles介绍

[英]Visitors
[中]访客

代码示例

代码示例来源:origin: locationtech/jts

/**
 * Gets a list of the triangles in the subdivision,
 * specified as an array of the triangle {@link Vertex}es.
 * 
 * @param includeFrame
 *          true if the frame triangles should be included
 * @return a List of Vertex[3] arrays
 */
public List getTriangleVertices(boolean includeFrame) {
  TriangleVertexListVisitor visitor = new TriangleVertexListVisitor();
  visitTriangles(visitor, includeFrame);
  return visitor.getTriangleVertices();
}

代码示例来源:origin: locationtech/jts

/**
 * Gets the coordinates for each triangle in the subdivision as an array.
 * 
 * @param includeFrame
 *          true if the frame triangles should be included
 * @return a list of Coordinate[4] representing each triangle
 */
public List getTriangleCoordinates(boolean includeFrame) {
  TriangleCoordinatesVisitor visitor = new TriangleCoordinatesVisitor();
  visitTriangles(visitor, includeFrame);
  return visitor.getTriangles();
}

代码示例来源:origin: locationtech/jts

/**
 * Gets a list of the triangles
 * in the subdivision, specified as
 * an array of the primary quadedges around the triangle.
 * 
 * @param includeFrame
 *          true if the frame triangles should be included
 * @return a List of QuadEdge[3] arrays
 */
public List getTriangleEdges(boolean includeFrame) {
  TriangleEdgesListVisitor visitor = new TriangleEdgesListVisitor();
  visitTriangles(visitor, includeFrame);
  return visitor.getTriangleEdges();
}

代码示例来源:origin: locationtech/jts

/**
  * Gets a List of {@link Polygon}s for the Voronoi cells 
  * of this triangulation.
 * <p>
 * The userData of each polygon is set to be the {@link Coordinate}
 * of the cell site.  This allows easily associating external 
 * data associated with the sites to the cells.
  * 
  * @param geomFact a geometry factory
  * @return a List of Polygons
  */
public List getVoronoiCellPolygons(GeometryFactory geomFact)
{
  /*
   * Compute circumcentres of triangles as vertices for dual edges.
   * Precomputing the circumcentres is more efficient, 
   * and more importantly ensures that the computed centres
   * are consistent across the Voronoi cells.
   */ 
  visitTriangles(new TriangleCircumcentreVisitor(), true);
  
 List cells = new ArrayList();
 Collection edges = getVertexUniqueEdges(false);
 for (Iterator i = edges.iterator(); i.hasNext(); ) {
   QuadEdge qe = (QuadEdge) i.next();
  cells.add(getVoronoiCellPolygon(qe, geomFact));
 }
 return cells;
}

代码示例来源:origin: locationtech/jts

/**
 * Creates {@link QuadEdgeTriangle}s for all facets of a 
 * {@link QuadEdgeSubdivision} representing a triangulation.
 * The <tt>data</tt> attributes of the {@link QuadEdge}s in the subdivision
 * will be set to point to the triangle which contains that edge.
 * This allows tracing the neighbour triangles of any given triangle.
 * 
 * @param subdiv
 *                 the QuadEdgeSubdivision to create the triangles on.
 * @return a List of the created QuadEdgeTriangles
 */
public static List createOn(QuadEdgeSubdivision subdiv)
{
  QuadEdgeTriangleBuilderVisitor visitor = new QuadEdgeTriangleBuilderVisitor();
  subdiv.visitTriangles(visitor, false);
  return visitor.getTriangles();
}

代码示例来源:origin: orbisgis/h2gis

subdivision.visitTriangles(new TriangleVisitorCircumCenter(circumcenter), false);
return geomCollection.getFactory().createMultiPoint(circumcenter.toArray(new Coordinate[0]));

相关文章