com.vividsolutions.jts.triangulate.quadedge.QuadEdgeSubdivision.getVertexUniqueEdges()方法的使用及代码示例

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

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

QuadEdgeSubdivision.getVertexUniqueEdges介绍

[英]Gets a collection of QuadEdges whose origin vertices are a unique set which includes all vertices in the subdivision. The frame vertices can be included if required.

This is useful for algorithms which require traversing the subdivision starting at all vertices. Returning a quadedge for each vertex is more efficient than the alternative of finding the actual vertices using #getVertices and then locating quadedges attached to them.
[中]获取四边形的集合,这些四边形的原点顶点是唯一的集合,其中包含细分中的所有顶点。如果需要,可以包括框架顶点。
这对于需要从所有顶点开始遍历细分的算法非常有用。为每个顶点返回四边形比使用#getVertices查找实际顶点,然后定位附加到它们的四边形更有效。

代码示例

代码示例来源:origin: com.vividsolutions/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: com.vividsolutions/jts-core

/**
  * 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;
}

相关文章