Revision 26866 branches/v2_0_0_prep/libraries/libFMap_geometries/src-test/org/gvsig/fmap/geom/primitive/SplineTest.java
SplineTest.java | ||
---|---|---|
33 | 33 |
import org.gvsig.fmap.geom.GeometryLibrary; |
34 | 34 |
import org.gvsig.fmap.geom.GeometryLocator; |
35 | 35 |
import org.gvsig.fmap.geom.GeometryManager; |
36 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
37 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
36 | 38 |
import org.slf4j.Logger; |
37 | 39 |
import org.slf4j.LoggerFactory; |
38 | 40 |
|
... | ... | |
59 | 61 |
} |
60 | 62 |
|
61 | 63 |
public void testCreateSpline2D() throws InstantiationException, IllegalAccessException{ |
62 |
Point point1 = (Point)manager.create(Point2D.CODE);
|
|
64 |
Point point1 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2D);
|
|
63 | 65 |
point1.setCoordinateAt(0, 1.0); |
64 | 66 |
point1.setCoordinateAt(1, 2.0); |
65 | 67 |
|
66 |
Point point2 = (Point)manager.create(Point2D.CODE);
|
|
68 |
Point point2 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2D);
|
|
67 | 69 |
point2.setCoordinateAt(0, 4.0); |
68 | 70 |
point2.setCoordinateAt(1, 5.0); |
69 | 71 |
|
70 |
Curve curve = (Curve)manager.create(Spline2D.CODE);
|
|
71 |
curve.addVertex(point1);
|
|
72 |
curve.addVertex(point2);
|
|
72 |
Spline spline = (Spline)manager.create(TYPES.SPLINE, SUBTYPES.GEOM2D);
|
|
73 |
spline.addVertex(point1);
|
|
74 |
spline.addVertex(point2);
|
|
73 | 75 |
|
74 |
Assert.assertEquals(1.0, curve.getCoordinateAt(0, 0), 0);
|
|
75 |
Assert.assertEquals(2.0, curve.getCoordinateAt(0, 1), 0);
|
|
76 |
Assert.assertEquals(1.0, spline.getCoordinateAt(0, 0), 0);
|
|
77 |
Assert.assertEquals(2.0, spline.getCoordinateAt(0, 1), 0);
|
|
76 | 78 |
|
77 | 79 |
} |
78 | 80 |
} |
Also available in: Unified diff