Package chunmap.model.elem

Examples of chunmap.model.elem.LineSegment


    public static CPoint refPoint(CoordinateSeq points, double distance)
    {
        checkArgument(points, distance);
        double len = 0;
        int i = 0;
        LineSegment lseg = null;
        for (int n = points.size() - 1; i < n; i++)
        {
            lseg = new LineSegment(points.getCoordinate(i), points.getCoordinate(i+1));
            len += lseg.getDistance();
            if (len > distance)
            {
                break;
            }
        }
        double l2 = len - distance;
        double d = lseg.getDistance();
        double l1 = d - l2;
        double lamuda = l1 / l2;
        return lseg.dingBiFenDian(lamuda);
    }
View Full Code Here


        // 分裂
        List<CPoint> points1 = new ArrayList<CPoint>();
        List<CPoint> points2 = new ArrayList<CPoint>();
        for (int i = 0, n = points.size() - 1; i < n; i++)
        {
            LineSegment lseg = new LineSegment(points.getCoordinate(i), points.getCoordinate(i+1));
            if (lseg.onLineSegment(p))
            {
                List<CPoint> tpoints = subList(points, 0, i + 1);
                points1.addAll(tpoints);
                points1.add(p);

                if (!lseg.onBorder(p))
                {
                    points2.add(p);
                }
                List<CPoint> tpoints2 = subList(points, i + 1, n + 1);
                points2.addAll(tpoints2);
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 (!containSegment(points, lseg))
            {
                return false;
            }
        }
View Full Code Here

    // 直接包含线段,不考虑线段跨结点情况
    static private boolean containSegment(CoordinateSeq points, LineSegment lseg)
    {
        for (int i = 0, n = points.size() - 1; i < n; i++)
        {
            LineSegment lseg2 = new LineSegment(points.getCoordinate(i), points.getCoordinate(i+1));
            if (lseg2.containLineSegment(lseg))
            {
                return true;
            }
        }
        return false;
View Full Code Here

    static public boolean onLineString(CoordinateSeq points, CPoint p)
    {
        for (int i = 0, n = points.size() - 1; i < n; i++)
        {
            LineSegment lseg = new LineSegment(points.getCoordinate(i), points.getCoordinate(i+1));
            if (lseg.onLineSegment(p))
                return true;
        }
        return false;
    }
View Full Code Here

        for (int i = 0, n = points.size() - 1; i < n; i++)
        {
            for (int j = i + 1; j < n; j++)
            {
                LineSegment ls1 = new LineSegment(points.getCoordinate(i), points.getCoordinate(i+1));
                LineSegment ls2 = new LineSegment(points.getCoordinate(j), points.getCoordinate(j+1));
                Object g = ls1.intersection(ls2);
                if (g == null)
                    continue;
                else if (g instanceof CPoint[])
                    return false;
View Full Code Here

    for (int i = 0, n = ls.size() - 1; i < n; i++) {
      CPoint p1 = ls.getPoint(i);
      CPoint p2 = ls.getPoint(i + 1);

      // 距离过小时不画
      LineSegment lseg = new LineSegment(p1, p2);
      if (lseg.taxiDistance() < dis)
        continue;

      LineString lsa = (LineString) getGeometry(p1, p2);
      GeneralPath path = toGeneralPath(lsa);
      g.fill(path);
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.