Revision 29097 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/EllipticArc2D.java
EllipticArc2D.java | ||
---|---|---|
51 | 51 |
import java.util.ArrayList; |
52 | 52 |
|
53 | 53 |
import org.cresques.cts.IProjection; |
54 |
import org.gvsig.fmap.geom.GeometryLocator;
|
|
54 |
import org.gvsig.fmap.geom.Geometry; |
|
55 | 55 |
import org.gvsig.fmap.geom.handler.AbstractHandler; |
56 | 56 |
import org.gvsig.fmap.geom.handler.CuadrantHandler; |
57 | 57 |
import org.gvsig.fmap.geom.handler.Handler; |
58 | 58 |
import org.gvsig.fmap.geom.primitive.EllipticArc; |
59 |
import org.gvsig.fmap.geom.primitive.FShape; |
|
60 | 59 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
61 | 60 |
import org.gvsig.fmap.geom.primitive.Point; |
62 | 61 |
import org.gvsig.fmap.geom.type.GeometryType; |
... | ... | |
72 | 71 |
public class EllipticArc2D extends Curve2D implements EllipticArc { |
73 | 72 |
private static final long serialVersionUID = 2988037614443119814L; |
74 | 73 |
|
75 |
private static GeometryType geomType = GeometryLocator.getGeometryManager() |
|
76 |
.registerGeometryType(EllipticArc2D.class, null, TYPES.ELLIPTICARC, SUBTYPES.GEOM2D); |
|
77 |
|
|
78 | 74 |
private Point2D axis1Start; |
79 | 75 |
private Point2D axis1End; |
80 | 76 |
private double semiAxis2Length; |
... | ... | |
82 | 78 |
private double angExt; |
83 | 79 |
|
84 | 80 |
/** |
85 |
* Constructor without arguments. It is necessary to create |
|
86 |
* geometries using the {@link GeometryType}{@link #create()} |
|
87 |
* method |
|
81 |
* The constructor with the GeometryType like and argument |
|
82 |
* is used by the {@link GeometryType}{@link #create()} |
|
83 |
* to create the geometry |
|
84 |
* @param type |
|
85 |
* The geometry type |
|
88 | 86 |
*/ |
89 |
public EllipticArc2D() { |
|
90 |
super(); |
|
87 |
public EllipticArc2D(GeometryType geometryType) {
|
|
88 |
super(geometryType);
|
|
91 | 89 |
} |
92 | 90 |
|
93 | 91 |
/** |
94 |
* DOCUMENT ME! |
|
95 |
* |
|
92 |
* Constructor used in the {@link Geometry#cloneGeometry()} method |
|
93 |
* @param id |
|
94 |
* @param projection |
|
96 | 95 |
* @param gpx |
96 |
* @param axis1Start |
|
97 |
* @param axis1End |
|
98 |
* @param semiAxis2Length |
|
99 |
* @param angSt |
|
100 |
* @param angExt |
|
97 | 101 |
*/ |
98 |
public EllipticArc2D(String id, IProjection projection, GeneralPathX gpx, Point2D axis1Start,Point2D axis1End, double semiAxis2Length, double angSt, double angExt) {
|
|
99 |
super(id, projection, gpx); |
|
102 |
EllipticArc2D(GeometryType geometryType, String id, IProjection projection, GeneralPathX gpx, Point2D axis1Start,Point2D axis1End, double semiAxis2Length, double angSt, double angExt) {
|
|
103 |
super(geometryType, id, projection, gpx);
|
|
100 | 104 |
this.axis1Start = axis1Start; |
101 | 105 |
this.axis1End = axis1End; |
102 | 106 |
this.semiAxis2Length = semiAxis2Length; |
... | ... | |
109 | 113 |
* @see org.gvsig.fmap.geom.primitive.EllipticArc#getAxis1Start() |
110 | 114 |
*/ |
111 | 115 |
public Point getAxis1Start(){ |
112 |
return new org.gvsig.fmap.geom.primitive.impl.Point2D(axis1Start); |
|
116 |
try { |
|
117 |
return new org.gvsig.fmap.geom.primitive.impl.Point2D(axis1Start); |
|
118 |
} catch (Exception e){ |
|
119 |
return null; |
|
120 |
} |
|
113 | 121 |
} |
114 | 122 |
|
115 | 123 |
/* |
... | ... | |
117 | 125 |
* @see org.gvsig.fmap.geom.primitive.EllipticArc#getAxis1End() |
118 | 126 |
*/ |
119 | 127 |
public Point getAxis1End(){ |
120 |
return new org.gvsig.fmap.geom.primitive.impl.Point2D(axis1End); |
|
128 |
try { |
|
129 |
return new org.gvsig.fmap.geom.primitive.impl.Point2D(axis1End); |
|
130 |
} catch (Exception e){ |
|
131 |
return null; |
|
132 |
} |
|
121 | 133 |
} |
122 | 134 |
|
123 | 135 |
/* |
... | ... | |
528 | 540 |
return gp.intersects(r); |
529 | 541 |
} |
530 | 542 |
|
531 |
public GeometryType getGeometryType() { |
|
532 |
return geomType; |
|
533 |
} |
|
534 |
|
|
535 | 543 |
/* (non-Javadoc) |
536 | 544 |
* @see org.gvsig.fmap.geom.primitive.EllipticArc#setPoints(org.gvsig.fmap.geom.primitive.Point, java.awt.geom.Point2D, double, double, double) |
537 | 545 |
*/ |
Also available in: Unified diff