/** * @param theSegment * Segment to test "be include" by <code>inThisSegment</code> * @param inThisSegment * Segment to test "includes" <code>theSegment</code> * @warning {@link #isIncludedCoordinate(List, List)} * @see #isIncludedCoordinate(List, List) */ private static boolean isIncludedSpatial(final SpatialSegment theSegment, final SpatialSegment inThisSegment) { return SegmentUtil.isIncludedCoordinate(theSegment.getCoordinate(), inThisSegment.getCoordinate()); }
/** * @param track * The track segment in which to add a spatio temporal * @param shape * An array of int containing coordinates to be affected to this segment. The smallest array is <code>{x1, y1, x2, y2}</code>. In this case * coordinate 1 (x1;y1) is the center of a disk, where coordinate 2 (x2;y2) is a point of the border. When shape contains more than tree * coordinates, it defines a closed polygon. * @return The newly created <code>SpatialSegment</code> */ public final static SpatialSegment createAndLinkSpatialSegment(final TrackSegment track, final int... shape) { final List<Coordinate> coordinates = SegmentFactory.checkAndcreateCoordinates(track, shape); final SpatialSegment theSeg = SegmentFactory.createAndLinkSegment(track, SpatialSegment.class); theSeg.getCoordinate().addAll(coordinates); return theSeg; }
/** * Creates a <code>SpatioTemporalSegment</code> at <code>timestamp</code>. A best practice is that timestamp is expressed in millisecond. * * @param mu * The <code>MediaUnit</code> containing the <code>Segment</code> * @param shape * An array of int containing coordinates to be affected to this segment. The smallest array is <code>{x1, y1, x2, y2}</code>. In this case * coordinate 1 (x1;y1) is the center of a disk, where coordinate 2 (x2;y2) is a point of the border. When shape contains more than tree * coordinates, it defines a closed polygon. * @return The newly created <code>SpatialSegment</code> */ public final static SpatialSegment createAndLinkSpatialSegment(final MediaUnit mu, final int... shape) { final List<Coordinate> coordinates = SegmentFactory.checkAndcreateCoordinates(mu, shape); final SpatialSegment theSeg = SegmentFactory.createAndLinkSegment(mu, SpatialSegment.class); theSeg.getCoordinate().addAll(coordinates); return theSeg; }
final SpatialSegment sSeg1 = (SpatialSegment) seg1; final SpatialSegment sSeg2 = (SpatialSegment) seg2; return this.compareCoordinates(sSeg1.getCoordinate(), sSeg2.getCoordinate());