Examples of CurveSegment


Examples of org.opengis.geometry.primitive.CurveSegment

    // TODO implementation
    // TODO test
    // TODO documentation
    if (this.curveSegments.isEmpty())
      return null;
    CurveSegment seg = this.curveSegments.get(0);
    LineStringImpl ls = (LineStringImpl) seg.asLineString(spacing, offset);
    // TODO Wirft fehler
    // UEber FActory instanzieren!
    LineStringImpl result = new LineStringImpl(ls);
    for (int i = 1; i < this.curveSegments.size(); ++i) {
      seg = this.curveSegments.get(i);
      ls = (LineStringImpl) seg.asLineString(spacing, offset);
      result = result.merge(ls);
    }
    /* Set StartParam for new LineString */
    result.setStartParam(this.getStartParam());
    /* Set EndParam for new LineString */
 
View Full Code Here

Examples of org.opengis.geometry.primitive.CurveSegment

   */
  public List<DirectPosition> asDirectPositions() {

    List<DirectPosition> rList = new ArrayList<DirectPosition>();

    CurveSegment tSegment = null;

    // Iterate all CurveSegments (= LineStrings)
    for (int i = 0; i < this.curveSegments.size(); i++) {
      tSegment = this.curveSegments.get(i);

      // TODO: This version only handles the CurveSegment type LineString
      LineStringImpl tLineString = (LineStringImpl) tSegment;

      Iterator<LineSegment> tLineSegmentIter = tLineString
          .asLineSegments().iterator();
      while (tLineSegmentIter.hasNext()) {
        LineSegment tLineSegment = tLineSegmentIter.next();
        // Add new Coordinate, which is the start point of the actual
        // LineSegment
        rList.add( tLineSegment.getStartPoint().getDirectPosition() );
      }
    }
    // Add new Coordinate, which is the end point of the last curveSegment
    rList.add( tSegment.getEndPoint() );
    return rList;
  }
View Full Code Here

Examples of org.opengis.geometry.primitive.CurveSegment

    for (int i = 0; i < this.elements.size(); i++) {

      CurveImpl tCurve = (CurveImpl) this.elements.get(i);
      Iterator<CurveSegment> tCurveSegmentIter = tCurve.getSegments()
          .iterator();
      CurveSegment tSegment = null;

      // Iterate all CurveSegments (= LineStrings)
      while (tCurveSegmentIter.hasNext()) {
        tSegment = tCurveSegmentIter.next();

        // TODO: This version only handles the CurveSegment type
        // LineString
        LineStringImpl tLineString = (LineStringImpl) tSegment;

        Iterator<LineSegment> tLineSegmentIter = tLineString
            .asLineSegments().iterator();
        while (tLineSegmentIter.hasNext()) {
          LineSegment tLineSegment = tLineSegmentIter.next();
          // Add new Coordinate, which is the start point of the
          // actual LineSegment
          rList.add( tLineSegment.getStartPoint());
        }
      }
      // Add new Coordinate, which is the end point of the last
      // curveSegment
      rList.add( tSegment.getEndPoint());
    }

    return rList;
  }
View Full Code Here

Examples of org.opengis.geometry.primitive.CurveSegment

        final List/*<Curve>*/ generators = (List) ring.getGenerators();
        for (int i = 0; i < generators.size(); i++) {
            final Curve curve = (Curve) generators.get(i);
            final List/*<CurveSegments>*/ segments = curve.getSegments();
            for (int j = 0; j < segments.size(); j++) {
                final CurveSegment curveSegment = (CurveSegment) segments.get(j);
                if (curveSegment instanceof LineString) {
                    final LineString lineString = (LineString) curveSegment;
                    final DirectPosition[] positions = getDirectPositions(lineString);
                    directPositionList.addAll(Arrays.asList(positions));
                    /*final List<Position> positions = lineString.getControlPoints().positions();
View Full Code Here

Examples of org.opengis.geometry.primitive.CurveSegment

        }
        if (i == n) {
            return ((CurveSegment) curveSegments.get(n-1)).getEndPoint();
        }
        else {
            CurveSegment cs = (CurveSegment) curveSegments.get(i);
            double d = cp - i; // 0 <= d < 1
            return cs.forConstructiveParam(
                (1-d) * cs.getStartConstructiveParam() +
                  d   * cs.getEndConstructiveParam());
        }
    }
View Full Code Here

Examples of org.sbml.jsbml.ext.layout.CurveSegment

            boundingBox.setDimensions(dimensions);
            return dimensions;
          }
        } else if (contextObject instanceof CurveSegment) {
          if (elementName.equals("start")) {
            CurveSegment lineSegment = (CurveSegment) contextObject;
            Point start = (Point) newContextObject;
            lineSegment.setStart(start);
            setNamespace(start, namespaceURI);
            return start;
          } else if (elementName.equals("end")) {
            CurveSegment lineSegment = (CurveSegment) contextObject;
            Point end = (Point) newContextObject;
            lineSegment.setEnd(end);
            setNamespace(end, namespaceURI);
            return end;
          } else if (elementName.equals("basePoint1")) {
            CubicBezier lineSegment = (CubicBezier) contextObject;

            BasePoint1 basePoint1 = (BasePoint1) newContextObject;
            lineSegment.setBasePoint1(basePoint1);
            setNamespace(basePoint1, namespaceURI);
            return basePoint1;
          } else if (elementName.equals("basePoint2")) {
            CubicBezier lineSegment = (CubicBezier) contextObject;
            BasePoint2 basePoint2 = (BasePoint2) newContextObject;
            lineSegment.setBasePoint2(basePoint2);
            setNamespace(basePoint2, namespaceURI);
            return basePoint2;
          }
        } else if (contextObject instanceof SpeciesReferenceGlyph
            && groupList.equals(LayoutList.listOfSpeciesReferenceGlyphs)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.