Revision 42982 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.jts/src/main/java/org/gvsig/fmap/geom/jts/DefaultGeometryManager.java
DefaultGeometryManager.java | ||
---|---|---|
605 | 605 |
|
606 | 606 |
} |
607 | 607 |
|
608 |
public MultiPoint createMultiPoint(GeneralPathX generalPathX, int subType) throws CreateGeometryException { |
|
609 |
if (subType != SUBTYPES.GEOM2D) { |
|
610 |
// FIXME Exception |
|
611 |
throw new UnsupportedOperationException(); |
|
612 |
} |
|
613 |
MultiPoint multiPoint = (MultiPoint) create(TYPES.MULTIPOINT, subType); |
|
614 |
PathIterator piter = generalPathX.getPathIterator(null); |
|
615 |
Point tmpPoint = null; |
|
616 |
double[] coords = new double[6]; |
|
617 |
int type; |
|
618 |
while (!piter.isDone()) { |
|
619 |
type = piter.currentSegment(coords); |
|
620 |
switch (type) { |
|
621 |
case PathIterator.SEG_MOVETO: |
|
622 |
tmpPoint = createPoint(coords[0], coords[1], subType); |
|
623 |
multiPoint.addPoint(tmpPoint); |
|
624 |
|
|
625 |
case PathIterator.SEG_LINETO: |
|
626 |
throw new IllegalArgumentException("The general have a SEG_LINETO."); |
|
627 |
|
|
628 |
case PathIterator.SEG_QUADTO: |
|
629 |
throw new IllegalArgumentException("The general have a SEG_QUADTO."); |
|
630 |
|
|
631 |
case PathIterator.SEG_CUBICTO: |
|
632 |
throw new IllegalArgumentException("The general have a SEG_CUBICTO."); |
|
633 |
|
|
634 |
case PathIterator.SEG_CLOSE: |
|
635 |
throw new IllegalArgumentException("The general have a SEG_CLOSE."); |
|
636 |
} // end switch |
|
637 |
|
|
638 |
piter.next(); |
|
639 |
|
|
640 |
} |
|
641 |
return multiPoint; |
|
642 |
|
|
643 |
} |
|
644 |
|
|
608 | 645 |
public int getGeometryOperationCode(String geomOpName) { |
609 | 646 |
if (geomOpName == null) { |
610 | 647 |
throw new IllegalArgumentException("geomOpName cannot be null."); |
Also available in: Unified diff