Revision 39082

View differences:

branches/v2_0_0_prep/libraries/libFMap_controls/src/org/gvsig/fmap/mapcontrol/tools/Behavior/Behavior.java
243 243
            LOG.error("Error creating and arc with p1=" + p1 + ", p2=" + p2
244 244
                + ",p3=" + p3, new CreateGeometryException(TYPES.ARC,
245 245
                SUBTYPES.GEOM2D, e));
246
		}
246
        } catch (IllegalArgumentException ex) {
247
            LOG.info("Warning: unable to create arc from points: "
248
                + p1.getX() + " " + p1.getY() + " :: "
249
                + p2.getX() + " " + p2.getY() + " :: "
250
                + p3.getX() + " " + p3.getY());
251
            arc = null;
252
        }
247 253
	    return arc;
248 254
	}
249 255
	
......
284 290
                    + centerY + ", radious=" + radious + ", angleStart="
285 291
                    + angleStart + ", angleExtent=" + angleExtent,
286 292
                new CreateGeometryException(TYPES.ARC, SUBTYPES.GEOM2D, e));
287
		}
293
        } catch (IllegalArgumentException ex) {
294
            LOG.info("Warning: unable to create arc from points.");
295
            arc = null;
296
        }
288 297
	    return arc;
289 298
	}
290 299

  
branches/v2_0_0_prep/libraries/libFMap_controls/src/org/gvsig/fmap/mapcontrol/tools/Behavior/CircleBehavior.java
118 118
			radio = p1.distance(p2);
119 119
			if(radio!=0.0){
120 120
				Arc arc = null;			
121
					arc = createArc(p1.getX(), p1.getY(),
122
							radio,
123
							0,
124
							Math.PI*2);
125
					mapControlDrawer.draw(arc);
121
				arc = createArc(p1.getX(), p1.getY(),
122
				    radio, 0, Math.PI*2);
123
				if (arc != null) {
124
				    mapControlDrawer.draw(arc);
125
				}
126 126
			}
127 127

  
128 128
		}
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/Arc2D.java
504 504
	private void setPoints(Point2D p1, Point2D p2, Point2D p3) {
505 505
		java.awt.geom.Arc2D arco = UtilFunctions.createArc(p1, p2, p3);
506 506
		if (arco == null) {
507
		    logger.info("Did not set arc points (probably aligned points): "
508
		        + p1.getX() + " " + p1.getY() + " :: "
509
		        + p2.getX() + " " + p2.getY() + " :: "
510
		        + p3.getX() + " " + p3.getY());
511
		    return;
507
            logger.info("Did not set arc points (probably aligned points): "
508
                + p1.getX() + " " + p1.getY() + " :: "
509
                + p2.getX() + " " + p2.getY() + " :: "
510
                + p3.getX() + " " + p3.getY());
511
		    throw new IllegalArgumentException("Did not set arc points (probably aligned points).");
512 512
		}
513 513
		this.gp = new GeneralPathX(arco.getPathIterator(null));
514 514
		this.init = p1;
branches/v2_0_0_prep/libraries/libDwg/src/org/gvsig/dwg/lib/objects/DwgArc.java
38 38
import java.util.List;
39 39
import java.util.Map;
40 40

  
41
import org.slf4j.Logger;
42
import org.slf4j.LoggerFactory;
43

  
41 44
import org.gvsig.dwg.lib.DwgFile;
42 45
import org.gvsig.dwg.lib.DwgObject;
43 46
import org.gvsig.dwg.lib.IDwg2FMap;
......
63 66
public class DwgArc extends DwgObject
64 67
	implements IDwgExtrusionable, IDwg3DTestable, IDwg2FMap, IDwgBlockMember {
65 68

  
69
    private static Logger logger = LoggerFactory.getLogger(DwgArc.class);
66 70
	private double[] center;
67 71
	private double radius;
68 72
	private double thickness;
......
186 190
		Arc arc = (Arc) gMan.create(getGeometryType(),getGeometrySubType(is3DFile));
187 191
		Point point = (Point) gMan.create(Geometry.TYPES.POINT,getGeometrySubType(is3DFile));
188 192
		point.setCoordinates(center);
189
		arc.setPoints(point, radius, angSt, -angExt);
193
		
194
		try {
195
		    arc.setPoints(point, radius, angSt, -angExt);
196
		} catch (IllegalArgumentException ex) {
197
		    logger.info("Unable to create arc from points.");
198
		    arc = null;
199
		}
200
		
190 201
		return arc;
191 202
	}
192 203

  
branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/gui/cad/DefaultCADTool.java
921 921
            LOG.error("Error creating arc with p1=" + p1, ", p2=" + p2
922 922
                + ", p3=" + p3, new CreateGeometryException(TYPES.ARC,
923 923
                getSubType(), e));
924
        } catch (IllegalArgumentException ex) {
925
            LOG.info("Warning: unable to create arc from points: "
926
                + p1.getX() + " " + p1.getY() + " :: "
927
                + p2.getX() + " " + p2.getY() + " :: "
928
                + p3.getX() + " " + p3.getY());
929
            arc = null;
924 930
        }
925 931
        return arc;
926 932
    }

Also available in: Unified diff