Revision 30954 branches/v2_0_0_prep/libraries/libFMap_geometries/src-test/org/gvsig/fmap/geom/GeometryManagerTest.java
GeometryManagerTest.java | ||
---|---|---|
92 | 92 |
//Point p = (Point) factory.createPoint2D(1, 2); |
93 | 93 |
Point p = (Point) manager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
94 | 94 |
|
95 |
GeometryOperationContext ctx = new GeometryOperationContext(); |
|
96 |
ctx.setAttribute("dummy", "DummyValue"); |
|
95 |
// TODO: implement again with the needed context for each operation |
|
97 | 96 |
|
98 |
try { |
|
99 |
p.invokeOperation(ToWKB.CODE, ctx); |
|
100 |
p.invokeOperation(ToJTS.CODE, ctx); |
|
101 |
p.invokeOperation(Flip.CODE, ctx); |
|
102 |
} catch (Exception e) { |
|
103 |
logger.error("Error, ", e); |
|
104 |
} |
|
97 |
// GeometryOperationContext ctx = new GeometryOperationContext(); |
|
98 |
// ctx.setAttribute("dummy", "DummyValue"); |
|
99 |
// p.invokeOperation(ToWKB.CODE, ctx); |
|
100 |
// p.invokeOperation(ToJTS.CODE, ctx); |
|
101 |
// p.invokeOperation(Flip.CODE, ctx); |
|
105 | 102 |
|
106 | 103 |
Geometry sol = manager.create(TYPES.SOLID, SUBTYPES.GEOM2DZ); |
107 | 104 |
assertNotNull(sol); |
... | ... | |
180 | 177 |
logger.debug("--------- Test GeneralPathX Operation END ----------"); |
181 | 178 |
} |
182 | 179 |
|
183 |
public void testInvoke() throws InstantiationException, IllegalAccessException, CreateGeometryException { |
|
184 |
int size = 100000; |
|
180 |
// TODO: implement again with the needed context for each operation |
|
181 |
// public void testInvoke() throws InstantiationException, |
|
182 |
// IllegalAccessException, CreateGeometryException { |
|
183 |
// int size = 100000; |
|
184 |
// |
|
185 |
// // Fill the operation context with required params |
|
186 |
// GeometryOperationContext ctx = new GeometryOperationContext(); |
|
187 |
// GeometryOperationContext var = new GeometryOperationContext(); |
|
188 |
// var.setAttribute("bCCW",new Boolean(true)); |
|
189 |
// |
|
190 |
// logger.debug("ToJTS.-"); |
|
191 |
// indirectInvoke(ToJTS.CODE, ctx, size); |
|
192 |
// directInvoke(ToJTS.CODE, ctx, size); |
|
193 |
// logger.debug("ToWKB.-"); |
|
194 |
// indirectInvoke(ToWKB.CODE, null, size); |
|
195 |
// directInvoke(ToWKB.CODE, null, size); |
|
196 |
// logger.debug("Flip.-"); |
|
197 |
// indirectInvoke(Flip.CODE, ctx, size); |
|
198 |
// directInvoke(Flip.CODE, ctx, size); |
|
199 |
// logger.debug("EnsureOrientation.-"); |
|
200 |
// //indirectInvoke(EnsureOrientation.CODE, var, size); |
|
201 |
// directInvoke(EnsureOrientation.CODE, var, size); |
|
202 |
// logger.debug("isCCW.-"); |
|
203 |
// //indirectInvoke(IsCCW.CODE, ctx, size); |
|
204 |
// directInvoke(IsCCW.CODE, ctx, size); |
|
205 |
// |
|
206 |
// } |
|
185 | 207 |
|
186 |
// Fill the operation context with required params |
|
187 |
GeometryOperationContext ctx = new GeometryOperationContext(); |
|
188 |
GeometryOperationContext var = new GeometryOperationContext(); |
|
189 |
var.setAttribute("bCCW",new Boolean(true)); |
|
190 |
|
|
191 |
logger.debug("ToJTS.-"); |
|
192 |
indirectInvoke(ToJTS.CODE, ctx, size); |
|
193 |
directInvoke(ToJTS.CODE, ctx, size); |
|
194 |
logger.debug("ToWKB.-"); |
|
195 |
indirectInvoke(ToWKB.CODE, null, size); |
|
196 |
directInvoke(ToWKB.CODE, null, size); |
|
197 |
logger.debug("Flip.-"); |
|
198 |
indirectInvoke(Flip.CODE, ctx, size); |
|
199 |
directInvoke(Flip.CODE, ctx, size); |
|
200 |
logger.debug("EnsureOrientation.-"); |
|
201 |
//indirectInvoke(EnsureOrientation.CODE, var, size); |
|
202 |
directInvoke(EnsureOrientation.CODE, var, size); |
|
203 |
logger.debug("isCCW.-"); |
|
204 |
//indirectInvoke(IsCCW.CODE, ctx, size); |
|
205 |
directInvoke(IsCCW.CODE, ctx, size); |
|
206 |
|
|
207 |
} |
|
208 |
|
|
209 | 208 |
private Geometry[] createGeometryArray(int size) throws InstantiationException, IllegalAccessException, CreateGeometryException { |
210 | 209 |
Geometry[] geom = new Geometry[size]; |
211 | 210 |
for (int i = 0; i < size; i++) { |
Also available in: Unified diff