当前位置: 首页>>代码示例>>Java>>正文


Java Position.RIGHT属性代码示例

本文整理汇总了Java中com.vividsolutions.jts.geomgraph.Position.RIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java Position.RIGHT属性的具体用法?Java Position.RIGHT怎么用?Java Position.RIGHT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.vividsolutions.jts.geomgraph.Position的用法示例。


在下文中一共展示了Position.RIGHT属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRightmostSideOfSegment

private int getRightmostSideOfSegment(DirectedEdge de, int i) {
    Edge e = de.getEdge();
    Coordinate coord[] = e.getCoordinates();

    if (i < 0 || i + 1 >= coord.length) {
        return -1;
    }
    if (coord[i].y == coord[i + 1].y) {
        return -1;    // indicates edge is parallel to x-axis
    }

    int pos = Position.LEFT;
    if (coord[i].y < coord[i + 1].y) {
        pos = Position.RIGHT;
    }
    return pos;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:17,代码来源:RightmostEdgeFinder.java

示例2: computeRingBufferCurve

private void computeRingBufferCurve(Coordinate[] inputPts, int side, OffsetSegmentGenerator segGen) {
        // simplify input line to improve performance
        double distTol = simplifyTolerance(this.distance);
        // ensure that correct side is simplified
        if (side == Position.RIGHT) {
            distTol = -distTol;
        }
        Coordinate[] simp = BufferInputLineSimplifier.simplify(inputPts, distTol);
//    Coordinate[] simp = inputPts;

        int n = simp.length - 1;
        segGen.initSideSegments(simp[n - 1], simp[0], side);
        for (int i = 1; i <= n; i++) {
            boolean addStartPoint = i != 1;
            segGen.addNextSegment(simp[i], addStartPoint);
        }
        segGen.closeRing();
    }
 
开发者ID:gegy1000,项目名称:Earth,代码行数:18,代码来源:OffsetCurveBuilder.java

示例3: computeRingBufferCurve

private void computeRingBufferCurve(Coordinate[] inputPts, int side, OffsetSegmentGenerator segGen) {
        // simplify input line to improve performance
        double distTol = simplifyTolerance(distance);
        // ensure that correct side is simplified
        if (side == Position.RIGHT)
            distTol = -distTol;
        Coordinate[] simp = BufferInputLineSimplifier.simplify(inputPts, distTol);
//    Coordinate[] simp = inputPts;

        int n = simp.length - 1;
        segGen.initSideSegments(simp[n - 1], simp[0], side);
        for (int i = 1; i <= n; i++) {
            boolean addStartPoint = i != 1;
            segGen.addNextSegment(simp[i], addStartPoint);
        }
        segGen.closeRing();
    }
 
开发者ID:Semantive,项目名称:jts,代码行数:17,代码来源:OffsetCurveBuilder.java

示例4: addNextSegment

public void addNextSegment(Coordinate p, boolean addStartPoint) {
    // s0-s1-s2 are the coordinates of the previous segment and the current one
    s0 = s1;
    s1 = s2;
    s2 = p;
    seg0.setCoordinates(s0, s1);
    computeOffsetSegment(seg0, side, distance, offset0);
    seg1.setCoordinates(s1, s2);
    computeOffsetSegment(seg1, side, distance, offset1);

    // do nothing if points are equal
    if (s1.equals(s2)) return;

    int orientation = CGAlgorithms.computeOrientation(s0, s1, s2);
    boolean outsideTurn =
            (orientation == CGAlgorithms.CLOCKWISE && side == Position.LEFT)
                    || (orientation == CGAlgorithms.COUNTERCLOCKWISE && side == Position.RIGHT);

    if (orientation == 0) { // lines are collinear
        addCollinear(addStartPoint);
    } else if (outsideTurn) {
        addOutsideTurn(orientation, addStartPoint);
    } else { // inside turn
        addInsideTurn(orientation, addStartPoint);
    }
}
 
开发者ID:Semantive,项目名称:jts,代码行数:26,代码来源:OffsetSegmentGenerator.java

示例5: computeRingBufferCurve

private void computeRingBufferCurve(Coordinate[] inputPts, int side, OffsetSegmentGenerator segGen)
  {
    // simplify input line to improve performance
    double distTol = simplifyTolerance(distance);
    // ensure that correct side is simplified
    if (side == Position.RIGHT)
      distTol = -distTol;
    Coordinate[] simp = BufferInputLineSimplifier.simplify(inputPts, distTol);
//    Coordinate[] simp = inputPts;
    
    int n = simp.length - 1;
    segGen.initSideSegments(simp[n - 1], simp[0], side);
    for (int i = 1; i <= n; i++) {
      boolean addStartPoint = i != 1;
      segGen.addNextSegment(simp[i], addStartPoint);
    }
    segGen.closeRing();
  }
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:18,代码来源:OffsetCurveBuilder.java

示例6: merge

/**
 * merge updates only the NULL attributes of this object
 * with the attributes of another.
 */
public void merge(TopologyLocation gl)
{
  // if the src is an Area label & and the dest is not, increase the dest to be an Area
  if (gl.location.length > location.length) {
    int [] newLoc = new int[3];
    newLoc[Position.ON] = location[Position.ON];
    newLoc[Position.LEFT] = Location.NONE;
    newLoc[Position.RIGHT] = Location.NONE;
    location = newLoc;
  }
  for (int i = 0; i < location.length; i++) {
    if (location[i] == Location.NONE && i < gl.location.length)
      location[i] = gl.location[i];
  }
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:19,代码来源:TopologyLocation.java

示例7: addNextSegment

public void addNextSegment(Coordinate p, boolean addStartPoint) {
    // s0-s1-s2 are the coordinates of the previous segment and the current one
    this.s0 = this.s1;
    this.s1 = this.s2;
    this.s2 = p;
    this.seg0.setCoordinates(this.s0, this.s1);
    this.computeOffsetSegment(this.seg0, this.side, this.distance, this.offset0);
    this.seg1.setCoordinates(this.s1, this.s2);
    this.computeOffsetSegment(this.seg1, this.side, this.distance, this.offset1);

    // do nothing if points are equal
    if (this.s1.equals(this.s2)) {
        return;
    }

    int orientation = CGAlgorithms.computeOrientation(this.s0, this.s1, this.s2);
    boolean outsideTurn =
            (orientation == CGAlgorithms.CLOCKWISE && this.side == Position.LEFT)
                    || (orientation == CGAlgorithms.COUNTERCLOCKWISE && this.side == Position.RIGHT);

    if (orientation == 0) { // lines are collinear
        this.addCollinear(addStartPoint);
    } else if (outsideTurn) {
        this.addOutsideTurn(orientation, addStartPoint);
    } else { // inside turn
        this.addInsideTurn(orientation, addStartPoint);
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:28,代码来源:OffsetSegmentGenerator.java

示例8: addNextSegment

public void addNextSegment(Coordinate p, boolean addStartPoint)
{
  // s0-s1-s2 are the coordinates of the previous segment and the current one
  s0 = s1;
  s1 = s2;
  s2 = p;
  seg0.setCoordinates(s0, s1);
  computeOffsetSegment(seg0, side, distance, offset0);
  seg1.setCoordinates(s1, s2);
  computeOffsetSegment(seg1, side, distance, offset1);

  // do nothing if points are equal
  if (s1.equals(s2)) return;

  int orientation = CGAlgorithms.computeOrientation(s0, s1, s2);
  boolean outsideTurn =
        (orientation == CGAlgorithms.CLOCKWISE        && side == Position.LEFT)
    ||  (orientation == CGAlgorithms.COUNTERCLOCKWISE && side == Position.RIGHT);

  if (orientation == 0) { // lines are collinear
    addCollinear(addStartPoint);
  }
  else if (outsideTurn) 
  {
    addOutsideTurn(orientation, addStartPoint);
  }
  else { // inside turn
    addInsideTurn(orientation, addStartPoint);
  }
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:30,代码来源:OffsetSegmentGenerator.java

示例9: flip

public void flip()
{
  if (location.length <= 1) return;
  int temp = location[Position.LEFT];
  location[Position.LEFT] = location[Position.RIGHT];
  location[Position.RIGHT] = temp;
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:7,代码来源:TopologyLocation.java

示例10: addPolygon

private void addPolygon(Polygon p) {
    double offsetDistance = this.distance;
    int offsetSide = Position.LEFT;
    if (this.distance < 0.0) {
        offsetDistance = -this.distance;
        offsetSide = Position.RIGHT;
    }

    LinearRing shell = (LinearRing) p.getExteriorRing();
    Coordinate[] shellCoord = CoordinateArrays.removeRepeatedPoints(shell.getCoordinates());
    // optimization - don't bother computing buffer
    // if the polygon would be completely eroded
    if (this.distance < 0.0 && this.isErodedCompletely(shell, this.distance)) {
        return;
    }
    // don't attemtp to buffer a polygon with too few distinct vertices
    if (this.distance <= 0.0 && shellCoord.length < 3) {
        return;
    }

    this.addPolygonRing(
            shellCoord,
            offsetDistance,
            offsetSide,
            Location.EXTERIOR,
            Location.INTERIOR);

    for (int i = 0; i < p.getNumInteriorRing(); i++) {

        LinearRing hole = (LinearRing) p.getInteriorRingN(i);
        Coordinate[] holeCoord = CoordinateArrays.removeRepeatedPoints(hole.getCoordinates());

        // optimization - don't bother computing buffer for this hole
        // if the hole would be completely covered
        if (this.distance > 0.0 && this.isErodedCompletely(hole, -this.distance)) {
            continue;
        }

        // Holes are topologically labelled opposite to the shell, since
        // the interior of the polygon lies on their opposite side
        // (on the left, if the hole is oriented CCW)
        this.addPolygonRing(
                holeCoord,
                offsetDistance,
                Position.opposite(offsetSide),
                Location.INTERIOR,
                Location.EXTERIOR);
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:49,代码来源:OffsetCurveSetBuilder.java

示例11: addPolygon

private void addPolygon(Polygon p) {
    double offsetDistance = distance;
    int offsetSide = Position.LEFT;
    if (distance < 0.0) {
        offsetDistance = -distance;
        offsetSide = Position.RIGHT;
    }

    LinearRing shell = (LinearRing) p.getExteriorRing();
    Coordinate[] shellCoord = CoordinateArrays.removeRepeatedPoints(shell.getCoordinates());
    // optimization - don't bother computing buffer
    // if the polygon would be completely eroded
    if (distance < 0.0 && isErodedCompletely(shell, distance))
        return;
    // don't attemtp to buffer a polygon with too few distinct vertices
    if (distance <= 0.0 && shellCoord.length < 3)
        return;

    addPolygonRing(
            shellCoord,
            offsetDistance,
            offsetSide,
            Location.EXTERIOR,
            Location.INTERIOR);

    for (int i = 0; i < p.getNumInteriorRing(); i++) {

        LinearRing hole = (LinearRing) p.getInteriorRingN(i);
        Coordinate[] holeCoord = CoordinateArrays.removeRepeatedPoints(hole.getCoordinates());

        // optimization - don't bother computing buffer for this hole
        // if the hole would be completely covered
        if (distance > 0.0 && isErodedCompletely(hole, -distance))
            continue;

        // Holes are topologically labelled opposite to the shell, since
        // the interior of the polygon lies on their opposite side
        // (on the left, if the hole is oriented CCW)
        addPolygonRing(
                holeCoord,
                offsetDistance,
                Position.opposite(offsetSide),
                Location.INTERIOR,
                Location.EXTERIOR);
    }
}
 
开发者ID:Semantive,项目名称:jts,代码行数:46,代码来源:OffsetCurveSetBuilder.java

示例12: getDelta

public int getDelta(int geomIndex)
{
  return depth[geomIndex][Position.RIGHT] - depth[geomIndex][Position.LEFT];
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:4,代码来源:Depth.java

示例13: setLocations

public void setLocations(int on, int left, int right) {
    location[Position.ON] = on;
    location[Position.LEFT] = left;
    location[Position.RIGHT] = right;
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:5,代码来源:TopologyLocation.java

示例14: TopologyLocation

/**
 * Constructs a TopologyLocation specifying how points on, to the left of, and to the
 * right of some GraphComponent relate to some Geometry. Possible values for the
 * parameters are Location.NULL, Location.EXTERIOR, Location.BOUNDARY,
 * and Location.INTERIOR.
 * @see Location
 */
public TopologyLocation(int on, int left, int right) {
 init(3);
 location[Position.ON] = on;
 location[Position.LEFT] = left;
 location[Position.RIGHT] = right;
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:13,代码来源:TopologyLocation.java


注:本文中的com.vividsolutions.jts.geomgraph.Position.RIGHT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。