public final DirectPosition forConstructiveParam(double cp) { int n = curveSegments.size(); int i = (int) cp; if (i < 0) { i = 0; } else if (i > n) { i = n; } 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()); } }
/** * @inheritDoc * @see org.opengis.geometry.coordinate.GenericCurve#getStartPoint() */ public final DirectPosition getStartPoint() { return ((CurveSegment) curveSegments.get(0)).getStartPoint(); }
/** * @inheritDoc * @see org.opengis.geometry.coordinate.GenericCurve#getEndPoint() */ public final DirectPosition getEndPoint() { return ((CurveSegment) curveSegments.get(curveSegments.size()-1)).getEndPoint(); }
public CurveSegmentAdapter(final CurveSegment lineString) { this.positions = lineString.getSamplePoints().positions(); }
LineString lineString = curveSegment.asLineString(0, 0); List<LineSegment> lineSegments = lineString.asLineSegments(); for (LineSegment lineSegment : lineSegments)
/** * {@inheritDoc } */ @Override public final DirectPosition getEndPoint() { return (curveSegments.get(curveSegments.size() - 1)).getEndPoint(); }
private String lineStringCoordToStringWithoutFirstCoord(CurveSegment ls) { return pointArrayCoordToStringWithoutFirstCoord(ls.getSamplePoints()); }
public LineStringImpl asLineString(double spacing, double offset) { // TODO semantic SJ, JR // 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 */ result.setEndParam(this.getEndParam()); return result; }
public final DirectPosition forConstructiveParam(double cp) { int n = curveSegments.size(); int i = (int) cp; if (i < 0) { i = 0; } else if (i > n) { i = n; } 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()); } }
/** * @inheritDoc * @see org.opengis.geometry.coordinate.GenericCurve#getEndPoint() */ public final DirectPosition getEndPoint() { return ((CurveSegment) curveSegments.get(curveSegments.size()-1)).getEndPoint(); }
/** * @inheritDoc * @see org.opengis.geometry.coordinate.GenericCurve#getStartPoint() */ public final DirectPosition getStartPoint() { return ((CurveSegment) curveSegments.get(0)).getStartPoint(); }
@Override public final DirectPosition forConstructiveParam(final double cp) { int n = curveSegments.size(); int i = (int) cp; if (i < 0) { i = 0; } else if (i > n) { i = n; } if (i == n) { return (curveSegments.get(n - 1)).getEndPoint(); } else { CurveSegment cs = curveSegments.get(i); double d = cp - i; // 0 <= d < 1 return cs.forConstructiveParam( (1-d) * cs.getStartConstructiveParam() + d * cs.getEndConstructiveParam()); } }
/** * The operations "endPoint" shall return the DirectPositions of the last * point, respectively on the GenericCurve. This differs from the boundary * operator in Primitive, since it returns only the values of these two * points, not representative objects. GenericCurve::startPoint() : * DirectPosition2D * * @return an <code>DirectPosition2D</code> value */ /* * (non-Javadoc) * * @see org.opengis.geometry.coordinate.GenericCurve#getEndPoint() */ public DirectPosition getEndPoint() { /* Return End Point of last CurveSegment */ return this.curveSegments.get(this.curveSegments.size() - 1) .getEndPoint(); }
/** * The operations "startPoint" shall return the DirectPositions of the first * point, respectively on the GenericCurve. This differs from the boundary * operator in Primitive, since it returns only the values of these two * points, not representative objects. GenericCurve::startPoint() : * DirectPosition2D * * @return an <code>DirectPosition2D</code> value */ public DirectPosition getStartPoint() { // Return first Point of this curve return this.curveSegments.get(0).getStartPoint(); }
rList.add( tSegment.getEndPoint());
/** * {@inheritDoc } */ @Override public final DirectPosition getStartPoint() { return (curveSegments.get(0)).getStartPoint(); }
/** * Returns the DirectPositions which define the control points of this Curve * * @return */ 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().getPosition() ); } } // Add new Coordinate, which is the end point of the last curveSegment rList.add( tSegment.getEndPoint() ); return rList; }