Revision 4835

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/GeneralPathX.java
133 133
     * @see #WIND_NON_ZERO
134 134
     */
135 135
    public GeneralPathX() {
136
	this(WIND_NON_ZERO, INIT_SIZE, INIT_SIZE);
136
	// this(WIND_NON_ZERO, INIT_SIZE, INIT_SIZE);
137
    	this(WIND_EVEN_ODD, INIT_SIZE, INIT_SIZE);
137 138
    }
138 139

  
139 140
    /**
......
193 194
     * @param s the specified <code>Shape</code> object
194 195
     */
195 196
    public GeneralPathX(Shape s) {
196
	this(WIND_NON_ZERO, INIT_SIZE, INIT_SIZE);
197
	// this(WIND_NON_ZERO, INIT_SIZE, INIT_SIZE);
198
    	this(WIND_EVEN_ODD, INIT_SIZE, INIT_SIZE);
197 199
	PathIterator pi = s.getPathIterator(null);
198 200
	setWindingRule(pi.getWindingRule());
199 201
	append(pi, false);
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FConverter.java
46 46
 */
47 47
package com.iver.cit.gvsig.fmap.core.v02;
48 48

  
49
import java.awt.Shape;
49 50
import java.awt.geom.AffineTransform;
51
import java.awt.geom.Area;
50 52
import java.awt.geom.NoninvertibleTransformException;
51 53
import java.awt.geom.PathIterator;
52 54
import java.awt.geom.Point2D;
......
564 566
	 * @return DOCUMENT ME!
565 567
	 *
566 568
	 * @throws NoninvertibleTransformException DOCUMENT ME!
567
	 */
569
	 *
568 570
	private Coordinate[] toViewCoordinates(Coordinate[] modelCoordinates)
569 571
		throws NoninvertibleTransformException {
570 572
		Coordinate[] viewCoordinates = new Coordinate[modelCoordinates.length];
571 573

  
572 574
		for (int i = 0; i < modelCoordinates.length; i++) {
573
			FPoint2D point2D = toViewPoint(modelCoordinates[i]);
575
			FPoint2D point2D = coordinate2FPoint2D(modelCoordinates[i]);
574 576
			viewCoordinates[i] = new Coordinate(point2D.getX(), point2D.getY());
575 577
		}
576 578

  
577 579
		return viewCoordinates;
578
	}
580
	} */
579 581

  
580 582
	/* private Shape toShape(GeometryCollection gc)
581 583
	   throws NoninvertibleTransformException {
......
612 614
	private static GeneralPathX toShape(LineString lineString)
613 615
		throws NoninvertibleTransformException {
614 616
		GeneralPathX shape = new GeneralPathX();
615
		FPoint2D viewPoint = toViewPoint(lineString.getCoordinateN(0));
617
		FPoint2D viewPoint = coordinate2FPoint2D(lineString.getCoordinateN(0));
616 618
		shape.moveTo(viewPoint.getX(), viewPoint.getY());
617 619

  
618 620
		for (int i = 1; i < lineString.getNumPoints(); i++) {
619
			viewPoint = toViewPoint(lineString.getCoordinateN(i));
621
			viewPoint = coordinate2FPoint2D(lineString.getCoordinateN(i));
620 622
			shape.lineTo(viewPoint.getX(), viewPoint.getY());
621 623
		}
622 624

  
......
636 638
	 */
637 639
	private static FPoint2D toShape(Point point)
638 640
		throws NoninvertibleTransformException {
639
		FPoint2D viewPoint = toViewPoint(point.getCoordinate());
641
		FPoint2D viewPoint = coordinate2FPoint2D(point.getCoordinate());
640 642

  
641 643
		return viewPoint;
642 644
	}
......
661 663
	 *
662 664
	 * @return DOCUMENT ME!
663 665
	 */
664
	private static FPoint2D toViewPoint(Coordinate coord) {
666
	private static FPoint2D coordinate2FPoint2D(Coordinate coord) {
665 667
		return new FPoint2D(coord.x, coord.y); //,coord.z);
666 668
	}
667 669

  
......
895 897
     * @param coordinates
896 898
     * @return
897 899
     */
898
    public static IGeometry gePolygon(Coordinate[] coordinates)
900
    public static IGeometry getExteriorPolygon(Coordinate[] coordinates)
899 901
    {
900 902
    	// isCCW = true => it's a hole
901 903
    	Coordinate[] vs=new Coordinate[coordinates.length];
......
915 917
		}    	
916 918
		return null;
917 919
    }
920
    
921
    /**
922
     * Return a hole (CCW ordered points)
923
     * @param coordinates
924
     * @return
925
     */
926
    public static IGeometry getHole(Coordinate[] coordinates)
927
    {
928
    	// isCCW = true => it's a hole
929
    	Coordinate[] vs=new Coordinate[coordinates.length];
930
        if (CGAlgorithms.isCCW(coordinates)){
931
        	vs=coordinates;
932

  
933
        }else{
934
        	for (int i=vs.length-1;i>=0;i--){
935
        		vs[i]=coordinates[i];
936
        	}        	
937
        }
938
        LinearRing ring = geomFactory.createLinearRing(vs);
939
        
940
        try {
941
			return ShapeFactory.createPolygon2D(toShape(ring));
942
		} catch (NoninvertibleTransformException e) {
943
			e.printStackTrace();
944
		}    	
945
		return null;
946
    }
947

  
948
	public static Shape getExteriorPolygon(GeneralPathX gp) {
949
		Area area = new Area(gp);
950
		
951
		return area;
952
		
953
		
954
	}
955
    
918 956
    /* public static GeometryCollection convertFGeometryCollection(FGeometryCollection fGeomC)
919 957
    {
920 958

  
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/VectorialEditableAdapter.java
45 45
 *
46 46
 * $Id$
47 47
 * $Log$
48
 * Revision 1.43  2006-04-11 12:12:29  fjp
48
 * Revision 1.44  2006-04-12 17:13:39  fjp
49
 * *** empty log message ***
50
 *
51
 * Revision 1.43  2006/04/11 12:12:29  fjp
49 52
 * Con edici?n en PostGIS y guardando pseudo-arcos en los shapes.
50 53
 *
51 54
 * Revision 1.42  2006/04/11 06:53:20  fjp
......
336 339
     * @throws EditionException DOCUMENT ME!
337 340
     */
338 341
    public void startEdition() throws EditionException {
339
    	isEditing = true;
342
    	super.startEdition();
340 343

  
341 344
        try {
342 345
            expansionFile.open();

Also available in: Unified diff