Revision 28396 branches/v2_0_0_prep/libraries/libFMap_geometries/src-test/org/gvsig/fmap/geom/GeometryManagerTest.java
GeometryManagerTest.java | ||
---|---|---|
34 | 34 |
} |
35 | 35 |
|
36 | 36 |
private GeometryManager manager; |
37 |
|
|
37 |
|
|
38 | 38 |
protected void setUp() throws Exception { |
39 | 39 |
super.setUp(); |
40 | 40 |
|
41 |
DefaultGeometryLibrary lib = new DefaultGeometryLibrary();
|
|
41 |
DefaultGeometryLibrary lib = new DefaultGeometryLibrary(); |
|
42 | 42 |
lib.initialize(); |
43 | 43 |
lib.postInitialize(); |
44 |
|
|
44 |
|
|
45 | 45 |
DefaultGeometryOperationLibrary opLib = new DefaultGeometryOperationLibrary(); |
46 | 46 |
opLib.initialize(); |
47 |
opLib.postInitialize();
|
|
48 |
|
|
47 |
opLib.postInitialize(); |
|
48 |
|
|
49 | 49 |
manager = GeometryLocator.getGeometryManager(); |
50 | 50 |
} |
51 | 51 |
|
... | ... | |
57 | 57 |
Point p2d = (Point) manager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
58 | 58 |
p2d.setCoordinateAt(0, 0); |
59 | 59 |
p2d.setCoordinateAt(1, 0); |
60 |
|
|
60 |
|
|
61 | 61 |
java.awt.geom.Point2D pt1 = new java.awt.geom.Point2D.Float(0,1); |
62 | 62 |
java.awt.geom.Point2D pt2 = new java.awt.geom.Point2D.Float(1,1); |
63 | 63 |
java.awt.geom.Point2D pt3 = new java.awt.geom.Point2D.Float(1,0); |
... | ... | |
94 | 94 |
|
95 | 95 |
//Point p = (Point) factory.createPoint2D(1, 2); |
96 | 96 |
Point p = (Point) manager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
97 |
|
|
97 |
|
|
98 | 98 |
GeometryOperationContext ctx = new GeometryOperationContext(); |
99 | 99 |
ctx.setAttribute("dummy", "DummyValue"); |
100 | 100 |
|
... | ... | |
129 | 129 |
// java.awt.geom.Point2D p1 = new java.awt.geom.Point2D.Double(1,2); |
130 | 130 |
// java.awt.geom.Point2D p2 = new java.awt.geom.Point2D.Double(2,1); |
131 | 131 |
// java.awt.geom.Point2D p3 = new java.awt.geom.Point2D.Double(3,3); |
132 |
|
|
132 |
|
|
133 | 133 |
Point p1 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
134 | 134 |
p1.setCoordinateAt(0, 1); |
135 |
p1.setCoordinateAt(1, 2);
|
|
136 |
|
|
135 |
p1.setCoordinateAt(1, 2); |
|
136 |
|
|
137 | 137 |
Point p2 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
138 | 138 |
p2.setCoordinateAt(0, 2); |
139 | 139 |
p2.setCoordinateAt(1, 1); |
140 |
|
|
140 |
|
|
141 | 141 |
Point p3 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
142 | 142 |
p3.setCoordinateAt(0, 3); |
143 |
p3.setCoordinateAt(1, 3);
|
|
144 |
|
|
143 |
p3.setCoordinateAt(1, 3); |
|
144 |
|
|
145 | 145 |
//Build a curve to get the operation invoked with the registered operation. |
146 | 146 |
//Geometry curve = (Curve) factory.createArc(p1, p2, p3); |
147 | 147 |
Arc arc = (Arc) manager.create(TYPES.ARC, SUBTYPES.GEOM2D); |
... | ... | |
195 | 195 |
indirectInvoke(ToJTS.CODE, ctx, size); |
196 | 196 |
directInvoke(ToJTS.CODE, ctx, size); |
197 | 197 |
logger.debug("ToWKB.-"); |
198 |
indirectInvoke(ToWKB.CODE, ctx, size);
|
|
199 |
directInvoke(ToWKB.CODE, ctx, size);
|
|
198 |
indirectInvoke(ToWKB.CODE, null, size);
|
|
199 |
directInvoke(ToWKB.CODE, null, size);
|
|
200 | 200 |
logger.debug("Flip.-"); |
201 | 201 |
indirectInvoke(Flip.CODE, ctx, size); |
202 | 202 |
directInvoke(Flip.CODE, ctx, size); |
... | ... | |
259 | 259 |
// Here is the main loop where you call the operation |
260 | 260 |
try { |
261 | 261 |
for (int i = 0; i < geoms.length; i++) { |
262 |
Object result = ((Geometry) geoms[i]).invokeOperation(opCode,
|
|
262 |
Object result = (geoms[i]).invokeOperation(opCode, |
|
263 | 263 |
ctx); |
264 | 264 |
// if(i%100 == 99) logger.debug(result); |
265 | 265 |
} |
Also available in: Unified diff