Package chunmap.model.elem

Examples of chunmap.model.elem.LineSegment


    {
        return getPoint(size() - 1);
    }
    public LineSegment getLineSegment(int i)
    {
        return new LineSegment(getPoint(i), getPoint(i + 1));
    }
View Full Code Here


            return;
        }

        for (int i = 0, n = size() - 1; i < n; i++)
        {
            LineSegment lseg = getLineSegment(i);
            if (lseg.onLineSegment(p))
            {
                if (lseg.onBorder(p))
                    return;
                else
                {
                    addAt(i + 1, p);
                    break;
View Full Code Here

    PointBuffer pb = new PointBuffer();
    // 开始点的缓冲
    Polygon pg = pb.createBuffer(ls.firstPoint(), distance);

    for (int i = 0, n = ls.size() - 1; i < n; i++) {
      LineSegment lseg = ls.getLineSegment(i);

      // 线的缓冲区
      Polygon lineBuffer = singleLineNoCapBuffer(lseg, distance);
      CPoint point = ls.getPoint(i + 1);
View Full Code Here

      CPoint p = r2.getPoint(i);
      tLine.tryInsertPoint(p);
    }
    // 片段在里面
    for (int i = 0, n = tLine.size() - 1; i < n; i++) {
      LineSegment lseg = tLine.getLineSegment(i);
      CPoint mp = lseg.getMiddlePoint();
      if (r2.containIn(mp) && !r2.onLineString(mp)) {
        return LineDim;
      }
    }
    return EmptyDim;
View Full Code Here

  public boolean _hasCross(LineString me,LineString l1) {
    LineString l2 = me;
    for (int i = 0, n = l1.size() - 1; i < n; i++) {
      for (int j = 0, n2 = l2.size() - 1; j < n2; j++) {
        LineSegment s1 = l1.getLineSegment(i);
        LineSegment s2 = l2.getLineSegment(j);
        Object g = s1.intersection(s2);
        if (g == null) {
          continue;
        } else if (g instanceof CPoint) {
          CPoint p = (CPoint) g;
View Full Code Here

    geoms.add(pb.createBuffer(p.getCoordinate(), 5));
    geoms.add(p);

    CPoint p1 = new Coordinate2D(-5, -5);
    CPoint p2 = new Coordinate2D(-10, -10);
    LineSegment lseg = new LineSegment(p1, p2);
    LineBuffer lb = new LineBuffer();
    geoms.add(lb.singleLineNoCapBuffer(lseg, 5));
    geoms.add(lseg.toLineString());
  }
View Full Code Here

        CoordSeqEditor tLine = new CoordSeqEditor(other);
        tLine.tryInsertAll(points);
        // 片段在里面
        for (int i = 0, n = tLine.size() - 1; i < n; i++)
        {
            LineSegment lseg = tLine.getLineSegment(i);
            if (!containIn(points,lseg.getMiddlePoint()))
            {
                return false;
            }
        }
        return true;
View Full Code Here

 
  //------------------------------------------------------------------------util

    public LineSegment getLineSegment(int i)
    {
        return new LineSegment(getPoint(i), getPoint(i+1));
    }
View Full Code Here

  protected CPoint getPrePoint() {
    return this.get(cursor - 1);
  }

  protected LineSegment getPreLineSegment() {
    return new LineSegment(get(cursor - 1), get(cursor));
  }
View Full Code Here

  protected CPoint getNextPoint() {
    return this.get(cursor + 1);
  }

  protected LineSegment getNextLineSegment() {
    return new LineSegment(get(cursor), get(cursor + 1));
  }
View Full Code Here

TOP

Related Classes of chunmap.model.elem.LineSegment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.