Package com.esri.core.geometry

Examples of com.esri.core.geometry.Point2D


    }
  }

  void fillMultiPath(SimpleRasterizer rasterizer, Transformation2D trans, MultiPathImpl polygon, boolean isWinding) {
    SegmentIteratorImpl segIter = polygon.querySegmentIterator();
    Point2D p1 = new Point2D();
    Point2D p2 = new Point2D();
    while (segIter.nextPath()) {
      while (segIter.hasNextSegment()) {
        Segment seg = segIter.nextSegment();
        if (seg.getType() != Geometry.Type.Line)
          throw GeometryException.GeometryInternalError(); // TODO:
View Full Code Here


  void strokeDrawPolyPath(SimpleRasterizer rasterizer,
      MultiPathImpl polyPath, double tol) {

    Point2D[] fan = new Point2D[4];
    for (int i = 0; i < fan.length; i++)
      fan[i] = new Point2D();

    SegmentIteratorImpl segIter = polyPath.querySegmentIterator();
    double strokeHalfWidth = m_transform.transform(tol) + 1.5;
    double shortSegment = 0.5;
    Point2D vec = new Point2D();
    Point2D vecA = new Point2D();
    Point2D vecB = new Point2D();

    // TODO check this Java workaroung
    Point2D ptStart = new Point2D();
    Point2D ptEnd = new Point2D();
    Envelope2D segEnv = new Envelope2D();
    Point2D ptOld = new Point2D();
    while (segIter.nextPath()) {
      boolean hasFan = false;
      boolean first = true;
      ptOld.setCoords(0, 0);
      while (segIter.hasNextSegment()) {
        Segment seg = segIter.nextSegment();
        ptStart.x = seg.getStartX();
        ptStart.y = seg.getStartY();// Point2D ptStart =
        // seg.getStartXY();
        ptEnd.x = seg.getEndX();
        ptEnd.y = seg.getEndY();// Point2D ptEnd = seg.getEndXY();
        segEnv.setEmpty();
        segEnv.merge(ptStart.x, ptStart.y);
        segEnv.mergeNE(ptEnd.x, ptEnd.y);
        if (!m_geomEnv.isIntersectingNE(segEnv)) {
          if (hasFan) {
            fillConvexPolygon(rasterizer, fan, 4);
            hasFan = false;
          }
          first = true;
          continue;
        }

        m_transform.transform(ptEnd, ptEnd);

        if (first) {
          m_transform.transform(ptStart, ptStart);
          ptOld.setCoords(ptStart);
          first = false;
        } else {
          ptStart.setCoords(ptOld);
        }

        vec.sub(ptEnd, ptStart);
        double len = vec.length();
        boolean bShort = len < shortSegment;
        if (len == 0) {
          vec.setCoords(1.0, 0);
          len = 1.0;
          continue;
        }

        if (!bShort)
          ptOld.setCoords(ptEnd);

        vec.scale(strokeHalfWidth / len);
        vecA.setCoords(-vec.y, vec.x);
        vecB.setCoords(vec.y, -vec.x);
        ptStart.sub(vec);
View Full Code Here

TOP

Related Classes of com.esri.core.geometry.Point2D

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.