Revision 4879
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FMultiPoint2D.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
import java.awt.Color; |
44 | 44 |
import java.awt.Graphics2D; |
45 |
import java.awt.Rectangle; |
|
45 | 46 |
import java.awt.geom.AffineTransform; |
46 | 47 |
import java.awt.geom.PathIterator; |
47 | 48 |
import java.awt.geom.Point2D; |
... | ... | |
50 | 51 |
import java.util.ArrayList; |
51 | 52 |
|
52 | 53 |
import org.cresques.cts.ICoordTrans; |
54 |
import org.geotools.data.postgis.attributeio.WKBEncoder; |
|
53 | 55 |
|
54 | 56 |
import com.iver.cit.gvsig.fmap.ViewPort; |
55 | 57 |
import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities; |
56 | 58 |
import com.iver.cit.gvsig.fmap.core.v02.FLabel; |
57 | 59 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
58 | 60 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
61 |
import com.vividsolutions.jts.geom.Coordinate; |
|
59 | 62 |
import com.vividsolutions.jts.geom.Geometry; |
63 |
import com.vividsolutions.jts.geom.GeometryFactory; |
|
64 |
import com.vividsolutions.jts.geom.MultiPoint; |
|
60 | 65 |
|
61 | 66 |
|
62 | 67 |
/** |
... | ... | |
104 | 109 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#toJTSGeometry() |
105 | 110 |
*/ |
106 | 111 |
public Geometry toJTSGeometry() { |
107 |
// TODO. |
|
108 |
return null; |
|
112 |
Coordinate[] theGeoms = new Coordinate[points.length]; |
|
113 |
for (int i = 0; i < theGeoms.length; i++) |
|
114 |
{ |
|
115 |
Coordinate c = new Coordinate(points[i].getX(), points[i].getY()); |
|
116 |
theGeoms[i] = c; |
|
117 |
} |
|
118 |
MultiPoint geomCol = new GeometryFactory().createMultiPoint(theGeoms); |
|
119 |
|
|
120 |
|
|
121 |
return geomCol; |
|
109 | 122 |
} |
110 | 123 |
|
111 | 124 |
/** |
... | ... | |
204 | 217 |
return points[i]; |
205 | 218 |
} |
206 | 219 |
/** |
207 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getGeneralPathXIterator()
|
|
220 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getPathIterator(AffineTransform)
|
|
208 | 221 |
*/ |
209 |
public GeneralPathXIterator getGeneralPathXIterator() {
|
|
222 |
public PathIterator getPathIterator(AffineTransform at) {
|
|
210 | 223 |
GeneralPathX gpx=new GeneralPathX(); |
211 | 224 |
if (getNumPoints()>0){ |
212 | 225 |
gpx.moveTo(points[0].getX(), points[0].getY()); |
... | ... | |
290 | 303 |
|
291 | 304 |
} |
292 | 305 |
public byte[] toWKB() throws IOException { |
293 |
// TODO Auto-generated method stub |
|
294 |
return null; |
|
306 |
return WKBEncoder.encodeGeometry(toJTSGeometry()); |
|
295 | 307 |
} |
296 |
public PathIterator getGeneralPathIterator(AffineTransform at, double flatness) {
|
|
308 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
|
297 | 309 |
GeneralPathX gpx=new GeneralPathX(); |
298 | 310 |
if (getNumPoints()>0){ |
299 | 311 |
gpx.moveTo(points[0].getX(), points[0].getY()); |
... | ... | |
304 | 316 |
return (GeneralPathXIterator)gpx.getPathIterator(at, flatness); |
305 | 317 |
|
306 | 318 |
} |
319 |
public boolean contains(double x, double y) { |
|
320 |
boolean bResul; |
|
321 |
for (int i=0; i < getNumPoints(); i++) |
|
322 |
{ |
|
323 |
bResul = points[i].contains(x,y); |
|
324 |
if (bResul) return true; |
|
325 |
} |
|
326 |
return false; |
|
327 |
} |
|
328 |
public boolean contains(double x, double y, double w, double h) { |
|
329 |
return false; |
|
330 |
} |
|
331 |
public boolean intersects(double x, double y, double w, double h) { |
|
332 |
boolean bResul; |
|
333 |
for (int i=0; i < getNumPoints(); i++) |
|
334 |
{ |
|
335 |
bResul = points[i].contains(x,y,w,h); |
|
336 |
if (bResul) return true; |
|
337 |
} |
|
338 |
return false; |
|
339 |
} |
|
340 |
public Rectangle getBounds() { |
|
341 |
Rectangle r=null; |
|
342 |
if (getNumPoints()>0){ |
|
343 |
r= points[0].getBounds(); |
|
344 |
} |
|
345 |
for (int i=1;i<getNumPoints();i++){ |
|
346 |
r.add(points[i].getX(),points[i].getY()); |
|
347 |
} |
|
348 |
return r; |
|
349 |
} |
|
350 |
public boolean contains(Point2D p) { |
|
351 |
boolean bResul; |
|
352 |
for (int i=0; i < getNumPoints(); i++) |
|
353 |
{ |
|
354 |
bResul = points[i].contains(p); |
|
355 |
if (bResul) return true; |
|
356 |
} |
|
357 |
return false; |
|
358 |
|
|
359 |
} |
|
360 |
public boolean contains(Rectangle2D r) { |
|
361 |
boolean bResul; |
|
362 |
for (int i=0; i < getNumPoints(); i++) |
|
363 |
{ |
|
364 |
bResul = points[i].contains(r); |
|
365 |
if (bResul) return true; |
|
366 |
} |
|
367 |
return false; |
|
368 |
|
|
369 |
} |
|
307 | 370 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/IGeometry.java | ||
---|---|---|
41 | 41 |
package com.iver.cit.gvsig.fmap.core; |
42 | 42 |
|
43 | 43 |
import java.awt.Graphics2D; |
44 |
import java.awt.Shape; |
|
44 | 45 |
import java.awt.geom.AffineTransform; |
45 | 46 |
import java.awt.geom.PathIterator; |
46 |
import java.awt.geom.Point2D; |
|
47 | 47 |
import java.awt.geom.Rectangle2D; |
48 | 48 |
import java.io.IOException; |
49 | 49 |
import java.io.Serializable; |
... | ... | |
63 | 63 |
* |
64 | 64 |
* @author $author$ |
65 | 65 |
*/ |
66 |
public interface IGeometry extends Serializable { |
|
66 |
public interface IGeometry extends Shape, Serializable {
|
|
67 | 67 |
public static int BEST = 0; |
68 | 68 |
public static int N = 1; |
69 | 69 |
public static int NE = 2; |
... | ... | |
190 | 190 |
|
191 | 191 |
/** |
192 | 192 |
* Devuelve el GeneralPathXIterator con la informaci?n relativa a la geometr?a. |
193 |
* @param at TODO |
|
193 | 194 |
* |
194 |
* @return GeneralPathXIterator.
|
|
195 |
* @return PathIterator.
|
|
195 | 196 |
*/ |
196 |
GeneralPathXIterator getGeneralPathXIterator();
|
|
197 |
PathIterator getPathIterator(AffineTransform at);
|
|
197 | 198 |
|
198 | 199 |
public byte[] toWKB() throws IOException; |
199 | 200 |
/** |
... | ... | |
208 | 209 |
|
209 | 210 |
public void transform(AffineTransform at); |
210 | 211 |
|
211 |
PathIterator getGeneralPathIterator(AffineTransform at, double flatness);
|
|
212 |
PathIterator getPathIterator(AffineTransform at, double flatness); |
|
212 | 213 |
|
213 | 214 |
//boolean intersects(IGeometry geom); |
214 | 215 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FGeometryCollection.java | ||
---|---|---|
41 | 41 |
package com.iver.cit.gvsig.fmap.core; |
42 | 42 |
|
43 | 43 |
import java.awt.Graphics2D; |
44 |
import java.awt.Rectangle; |
|
44 | 45 |
import java.awt.geom.AffineTransform; |
45 | 46 |
import java.awt.geom.PathIterator; |
47 |
import java.awt.geom.Point2D; |
|
46 | 48 |
import java.awt.geom.Rectangle2D; |
47 | 49 |
import java.io.IOException; |
48 | 50 |
import java.util.ArrayList; |
... | ... | |
200 | 202 |
} |
201 | 203 |
|
202 | 204 |
/** |
203 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getGeneralPathXIterator()
|
|
205 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getPathIterator(AffineTransform)
|
|
204 | 206 |
*/ |
205 |
public GeneralPathXIterator getGeneralPathXIterator() {
|
|
207 |
public PathIterator getPathIterator(AffineTransform at) {
|
|
206 | 208 |
// Necesitamos convertir todo esto a una GeneralPathX, tarde o temprano. |
207 | 209 |
// As? que lo intento aqu? por primera vez. |
208 | 210 |
// Lo necesitamos para la edici?n, porque se est?n |
... | ... | |
253 | 255 |
for (int i=0; i < geometries.size(); i++) |
254 | 256 |
{ |
255 | 257 |
IGeometry gAux = (IGeometry) geometries.get(i); |
256 |
gp.append(gAux.getGeneralPathXIterator(), true);
|
|
258 |
gp.append(gAux.getPathIterator(null), true);
|
|
257 | 259 |
} |
258 | 260 |
return (GeneralPathXIterator) gp.getPathIterator(null); |
259 | 261 |
} |
... | ... | |
325 | 327 |
} |
326 | 328 |
} |
327 | 329 |
|
328 |
public PathIterator getGeneralPathIterator(AffineTransform at, double flatness) {
|
|
330 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
|
329 | 331 |
GeneralPathX gp = new GeneralPathX(); |
330 | 332 |
for (int i=0; i < geometries.size(); i++) |
331 | 333 |
{ |
332 | 334 |
IGeometry gAux = (IGeometry) geometries.get(i); |
333 |
gp.append(gAux.getGeneralPathXIterator(), true);
|
|
335 |
gp.append(gAux.getPathIterator(null), true);
|
|
334 | 336 |
} |
335 | 337 |
return (GeneralPathXIterator) gp.getPathIterator(at, flatness); |
336 | 338 |
} |
339 |
|
|
340 |
public boolean contains(double x, double y) { |
|
341 |
boolean bRes; |
|
342 |
for (int i=0; i < geometries.size(); i++) |
|
343 |
{ |
|
344 |
IGeometry gAux = (IGeometry) geometries.get(i); |
|
345 |
bRes = gAux.contains(x,y); |
|
346 |
if (bRes) return bRes; |
|
347 |
} |
|
348 |
|
|
349 |
return false; |
|
350 |
} |
|
351 |
|
|
352 |
public boolean contains(double x, double y, double w, double h) { |
|
353 |
boolean bRes; |
|
354 |
for (int i=0; i < geometries.size(); i++) |
|
355 |
{ |
|
356 |
IGeometry gAux = (IGeometry) geometries.get(i); |
|
357 |
bRes = gAux.contains(x,y, w, h); |
|
358 |
if (bRes) return bRes; |
|
359 |
} |
|
360 |
|
|
361 |
return false; |
|
362 |
} |
|
363 |
|
|
364 |
public boolean intersects(double x, double y, double w, double h) { |
|
365 |
boolean bRes; |
|
366 |
for (int i=0; i < geometries.size(); i++) |
|
367 |
{ |
|
368 |
IGeometry gAux = (IGeometry) geometries.get(i); |
|
369 |
bRes = gAux.intersects(x,y, w, h); |
|
370 |
if (bRes) return bRes; |
|
371 |
} |
|
372 |
|
|
373 |
return false; |
|
374 |
} |
|
375 |
|
|
376 |
public Rectangle getBounds() { |
|
377 |
Rectangle rAux = null; |
|
378 |
|
|
379 |
for (int i = 0; i < geometries.size(); i++) |
|
380 |
if (rAux==null){ |
|
381 |
rAux=((IGeometry)geometries.get(i)).getBounds(); |
|
382 |
}else{ |
|
383 |
rAux.add(((IGeometry)geometries.get(i)).getBounds()); |
|
384 |
} |
|
385 |
return rAux; |
|
386 |
} |
|
387 |
|
|
388 |
public boolean contains(Point2D p) { |
|
389 |
boolean bRes; |
|
390 |
for (int i=0; i < geometries.size(); i++) |
|
391 |
{ |
|
392 |
IGeometry gAux = (IGeometry) geometries.get(i); |
|
393 |
bRes = gAux.contains(p); |
|
394 |
if (bRes) return bRes; |
|
395 |
} |
|
396 |
|
|
397 |
return false; |
|
398 |
} |
|
399 |
|
|
400 |
public boolean contains(Rectangle2D r) { |
|
401 |
boolean bRes; |
|
402 |
for (int i=0; i < geometries.size(); i++) |
|
403 |
{ |
|
404 |
IGeometry gAux = (IGeometry) geometries.get(i); |
|
405 |
bRes = gAux.contains(r); |
|
406 |
if (bRes) return bRes; |
|
407 |
} |
|
408 |
|
|
409 |
return false; |
|
410 |
} |
|
337 | 411 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FConverter.java | ||
---|---|---|
61 | 61 |
import com.iver.cit.gvsig.fmap.core.FPolyline2D; |
62 | 62 |
import com.iver.cit.gvsig.fmap.core.FShape; |
63 | 63 |
import com.iver.cit.gvsig.fmap.core.GeneralPathX; |
64 |
import com.iver.cit.gvsig.fmap.core.GeneralPathXIterator; |
|
65 | 64 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
66 | 65 |
import com.iver.cit.gvsig.fmap.core.ShapeFactory; |
67 | 66 |
import com.vividsolutions.jts.algorithm.CGAlgorithms; |
... | ... | |
791 | 790 |
double[] aux = new double[6]; |
792 | 791 |
|
793 | 792 |
// newGp.reset(); |
794 |
GeneralPathXIterator theIterator;
|
|
793 |
PathIterator theIterator;
|
|
795 | 794 |
int theType; |
796 | 795 |
int numParts = 0; |
797 | 796 |
|
... | ... | |
801 | 800 |
int xInt, yInt, antX = -1, antY = -1; |
802 | 801 |
|
803 | 802 |
|
804 |
theIterator = gp.getGeneralPathXIterator(); //, flatness);
|
|
803 |
theIterator = gp.getPathIterator(null); //, flatness);
|
|
805 | 804 |
int numSegmentsAdded = 0; |
806 | 805 |
while (!theIterator.isDone()) { |
807 | 806 |
theType = theIterator.currentSegment(theData); |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FNullGeometry.java | ||
---|---|---|
50 | 50 |
import org.cresques.cts.ICoordTrans; |
51 | 51 |
|
52 | 52 |
import java.awt.Graphics2D; |
53 |
import java.awt.Rectangle; |
|
53 | 54 |
import java.awt.geom.AffineTransform; |
54 | 55 |
import java.awt.geom.PathIterator; |
55 | 56 |
import java.awt.geom.Point2D; |
... | ... | |
126 | 127 |
|
127 | 128 |
|
128 | 129 |
/** |
129 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getGeneralPathXIterator()
|
|
130 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getPathIterator(AffineTransform)
|
|
130 | 131 |
*/ |
131 |
public GeneralPathXIterator getGeneralPathXIterator() {
|
|
132 |
public PathIterator getPathIterator(AffineTransform at) {
|
|
132 | 133 |
//TODO falta implementar. |
133 | 134 |
return null; |
134 | 135 |
} |
... | ... | |
169 | 170 |
|
170 | 171 |
} |
171 | 172 |
|
172 |
public PathIterator getGeneralPathIterator(AffineTransform at, double flatness) { |
|
173 |
// TODO Auto-generated method stub |
|
173 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
|
174 | 174 |
return null; |
175 | 175 |
} |
176 |
|
|
177 |
public boolean contains(double arg0, double arg1) { |
|
178 |
return false; |
|
179 |
} |
|
180 |
|
|
181 |
public boolean contains(double arg0, double arg1, double arg2, double arg3) { |
|
182 |
return false; |
|
183 |
} |
|
184 |
|
|
185 |
public boolean intersects(double arg0, double arg1, double arg2, double arg3) { |
|
186 |
return false; |
|
187 |
} |
|
188 |
|
|
189 |
public Rectangle getBounds() { |
|
190 |
return null; |
|
191 |
} |
|
192 |
|
|
193 |
public boolean contains(Point2D arg0) { |
|
194 |
return false; |
|
195 |
} |
|
196 |
|
|
197 |
public boolean contains(Rectangle2D arg0) { |
|
198 |
return false; |
|
199 |
} |
|
176 | 200 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FGeometry.java | ||
---|---|---|
47 | 47 |
package com.iver.cit.gvsig.fmap.core; |
48 | 48 |
|
49 | 49 |
import java.awt.Graphics2D; |
50 |
import java.awt.Rectangle; |
|
50 | 51 |
import java.awt.geom.AffineTransform; |
51 | 52 |
import java.awt.geom.PathIterator; |
52 | 53 |
import java.awt.geom.Point2D; |
... | ... | |
205 | 206 |
} |
206 | 207 |
|
207 | 208 |
/** |
208 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getGeneralPathXIterator()
|
|
209 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getPathIterator(AffineTransform)
|
|
209 | 210 |
*/ |
210 |
public GeneralPathXIterator getGeneralPathXIterator() {
|
|
211 |
public PathIterator getPathIterator(AffineTransform at) {
|
|
211 | 212 |
return (GeneralPathXIterator)shp.getPathIterator(null); |
212 | 213 |
} |
213 | 214 |
|
... | ... | |
246 | 247 |
/* (non-Javadoc) |
247 | 248 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getGeneralPathXIterator(java.awt.geom.AffineTransform, double) |
248 | 249 |
*/ |
249 |
public PathIterator getGeneralPathIterator(AffineTransform at, double flatness) {
|
|
250 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
|
250 | 251 |
return shp.getPathIterator(at, flatness); |
251 | 252 |
} |
252 | 253 |
|
254 |
public boolean contains(double x, double y) { |
|
255 |
return shp.contains(x,y); |
|
256 |
} |
|
257 |
|
|
258 |
public boolean contains(double x, double y, double w, double h) { |
|
259 |
return shp.contains(x,y,w,h); |
|
260 |
} |
|
261 |
|
|
262 |
public boolean intersects(double x, double y, double w, double h) { |
|
263 |
return shp.intersects(x,y,w,h); |
|
264 |
} |
|
265 |
|
|
266 |
public Rectangle getBounds() { |
|
267 |
return shp.getBounds(); |
|
268 |
} |
|
269 |
|
|
270 |
public boolean contains(Point2D p) { |
|
271 |
return shp.contains(p); |
|
272 |
} |
|
273 |
|
|
274 |
public boolean contains(Rectangle2D r) { |
|
275 |
return shp.contains(r); |
|
276 |
} |
|
277 |
|
|
253 | 278 |
/* public void move(double x, double y) { |
254 | 279 |
AffineTransform at = new AffineTransform(); |
255 | 280 |
at.translate(x, y); |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/Gt2Geometry.java | ||
---|---|---|
44 | 44 |
package com.iver.cit.gvsig.fmap.core; |
45 | 45 |
|
46 | 46 |
|
47 |
import java.awt.Graphics2D; |
|
48 |
import java.awt.Rectangle; |
|
49 |
import java.awt.geom.AffineTransform; |
|
50 |
import java.awt.geom.PathIterator; |
|
51 |
import java.awt.geom.Point2D; |
|
52 |
import java.awt.geom.Rectangle2D; |
|
53 |
import java.io.IOException; |
|
54 |
|
|
55 |
import org.cresques.cts.ICoordTrans; |
|
56 |
|
|
47 | 57 |
import com.iver.cit.gvsig.fmap.ViewPort; |
48 |
import com.iver.cit.gvsig.fmap.core.FPolyline2D.PointSelHandler; |
|
49 | 58 |
import com.iver.cit.gvsig.fmap.core.gt2.FLiteShape; |
50 |
import com.iver.cit.gvsig.fmap.core.v02.FConverter; |
|
51 | 59 |
import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities; |
52 | 60 |
import com.iver.cit.gvsig.fmap.core.v02.FLabel; |
53 | 61 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
54 | 62 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
55 |
|
|
56 |
import com.vividsolutions.jts.geom.Coordinate; |
|
57 | 63 |
import com.vividsolutions.jts.geom.Geometry; |
58 | 64 |
|
59 |
import org.cresques.cts.ICoordTrans; |
|
60 |
import org.geotools.renderer.lite.LiteShape; |
|
61 | 65 |
|
62 |
import java.awt.Graphics2D; |
|
63 |
import java.awt.geom.AffineTransform; |
|
64 |
import java.awt.geom.PathIterator; |
|
65 |
import java.awt.geom.Point2D; |
|
66 |
import java.awt.geom.Rectangle2D; |
|
67 |
import java.io.IOException; |
|
68 |
import java.io.Serializable; |
|
69 |
import java.util.ArrayList; |
|
70 |
|
|
71 |
|
|
72 | 66 |
/** |
73 | 67 |
* Geometr?a. |
74 | 68 |
* |
75 | 69 |
* @author FJP |
76 | 70 |
*/ |
77 | 71 |
public class Gt2Geometry implements IGeometry { |
78 |
private FLiteShape shp; |
|
72 |
/** |
|
73 |
* |
|
74 |
*/ |
|
75 |
private static final long serialVersionUID = 1587400440363673610L; |
|
76 |
private FLiteShape shp; |
|
79 | 77 |
|
80 | 78 |
|
81 | 79 |
|
... | ... | |
199 | 197 |
} |
200 | 198 |
|
201 | 199 |
/** |
202 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getGeneralPathXIterator()
|
|
200 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getPathIterator(AffineTransform)
|
|
203 | 201 |
*/ |
204 |
public GeneralPathXIterator getGeneralPathXIterator() {
|
|
202 |
public PathIterator getPathIterator(AffineTransform at) {
|
|
205 | 203 |
return (GeneralPathXIterator)shp.getPathIterator(null); |
206 | 204 |
} |
207 | 205 |
|
... | ... | |
234 | 232 |
|
235 | 233 |
} |
236 | 234 |
|
237 |
public PathIterator getGeneralPathIterator(AffineTransform at, double flatness) {
|
|
235 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
|
238 | 236 |
return (GeneralPathXIterator)shp.getPathIterator(at, flatness); |
239 | 237 |
} |
238 |
|
|
239 |
public boolean contains(double x, double y) { |
|
240 |
return shp.contains(x,y); |
|
241 |
} |
|
242 |
|
|
243 |
public boolean contains(double x, double y, double w, double h) { |
|
244 |
return shp.contains(x,y,w,h); |
|
245 |
} |
|
246 |
|
|
247 |
public boolean intersects(double x, double y, double w, double h) { |
|
248 |
return shp.intersects(x,y,w,h); |
|
249 |
} |
|
250 |
|
|
251 |
public Rectangle getBounds() { |
|
252 |
return shp.getBounds(); |
|
253 |
} |
|
254 |
|
|
255 |
public boolean contains(Point2D p) { |
|
256 |
return shp.contains(p); |
|
257 |
} |
|
258 |
|
|
259 |
public boolean contains(Rectangle2D r) { |
|
260 |
return shp.contains(r); |
|
261 |
} |
|
262 |
|
|
240 | 263 |
} |
241 | 264 |
|
242 | 265 |
|
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dxf/write/DxfGisWriter.java | ||
---|---|---|
129 | 129 |
handleGroup.setData(new Integer(handle+k).toString()); |
130 | 130 |
polv.add(handleGroup); |
131 | 131 |
Vector vpoints = new Vector(); |
132 |
GeneralPathXIterator theIterator = geom.getGeneralPathXIterator(); //polyLine.getPathIterator(null, flatness);
|
|
132 |
PathIterator theIterator = geom.getPathIterator(null); //polyLine.getPathIterator(null, flatness);
|
|
133 | 133 |
double[] theData = new double[6]; |
134 | 134 |
double[] velev = ((FGeometry)geom).getZs(); |
135 | 135 |
while (!theIterator.isDone()) { |
... | ... | |
254 | 254 |
polv.add(polylineFlag); |
255 | 255 |
|
256 | 256 |
Vector vpoints = new Vector(); |
257 |
GeneralPathXIterator theIterator = geom.getGeneralPathXIterator(); //polyLine.getPathIterator(null, flatness);
|
|
257 |
PathIterator theIterator = geom.getPathIterator(null); //polyLine.getPathIterator(null, flatness);
|
|
258 | 258 |
double[] theData = new double[6]; |
259 | 259 |
while (!theIterator.isDone()) { |
260 | 260 |
int theType = theIterator.currentSegment(theData); |
... | ... | |
297 | 297 |
handleGroup.setData(new Integer(handle+k).toString()); |
298 | 298 |
polv.add(handleGroup); |
299 | 299 |
Vector vpoints = new Vector(); |
300 |
GeneralPathXIterator theIterator = geom.getGeneralPathXIterator(); //polyLine.getPathIterator(null, flatness);
|
|
300 |
PathIterator theIterator = geom.getPathIterator(null); //polyLine.getPathIterator(null, flatness);
|
|
301 | 301 |
double[] theData = new double[6]; |
302 | 302 |
double[] velev = ((FGeometry)geom).getZs(); |
303 | 303 |
while (!theIterator.isDone()) { |
... | ... | |
417 | 417 |
handleGroup.setData(new Integer(handle+k).toString()); |
418 | 418 |
polv.add(handleGroup); |
419 | 419 |
Vector vpoints = new Vector(); |
420 |
GeneralPathXIterator theIterator = geom.getGeneralPathXIterator(); //polyLine.getPathIterator(null, flatness);
|
|
420 |
PathIterator theIterator = geom.getPathIterator(null); //polyLine.getPathIterator(null, flatness);
|
|
421 | 421 |
double[] theData = new double[6]; |
422 | 422 |
while (!theIterator.isDone()) { |
423 | 423 |
int theType = theIterator.currentSegment(theData); |
... | ... | |
457 | 457 |
private void createPoint3D(int handle, int k, IGeometry geom) throws Exception { |
458 | 458 |
FPoint3D point = new FPoint3D(0,0,0); |
459 | 459 |
double[] pointCoords = new double[6]; |
460 |
GeneralPathXIterator pointIt = geom.getGeneralPathXIterator();
|
|
460 |
PathIterator pointIt = geom.getPathIterator(null);
|
|
461 | 461 |
while (!pointIt.isDone()) { |
462 | 462 |
pointIt.currentSegment(pointCoords); |
463 | 463 |
point = new FPoint3D(pointCoords[0], pointCoords[1], pointCoords[2]); |
... | ... | |
495 | 495 |
private void createPoint2D(int handle, int k, IGeometry geom) throws Exception { |
496 | 496 |
FPoint2D point = new FPoint2D(0,0); |
497 | 497 |
double[] pointCoords = new double[6]; |
498 |
GeneralPathXIterator pointIt = geom.getGeneralPathXIterator();
|
|
498 |
PathIterator pointIt = geom.getPathIterator(null);
|
|
499 | 499 |
while (!pointIt.isDone()) { |
500 | 500 |
pointIt.currentSegment(pointCoords); |
501 | 501 |
point = new FPoint2D(pointCoords[0], pointCoords[1]); |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/write/SHPMultiLine.java | ||
---|---|---|
252 | 252 |
} |
253 | 253 |
ArrayList arrayPoints = null; |
254 | 254 |
ArrayList arrayParts = new ArrayList(); |
255 |
PathIterator theIterator = g.getGeneralPathIterator(null, flatness); //polyLine.getPathIterator(null, flatness);
|
|
255 |
PathIterator theIterator = g.getPathIterator(null, flatness); //polyLine.getPathIterator(null, flatness); |
|
256 | 256 |
double[] theData = new double[6]; |
257 | 257 |
int numParts = 0; |
258 | 258 |
while (!theIterator.isDone()) { |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/write/SHPMultiPoint.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.drivers.shp.write; |
42 | 42 |
|
43 |
import java.awt.geom.PathIterator; |
|
44 |
import java.awt.geom.Point2D; |
|
45 |
import java.awt.geom.Rectangle2D; |
|
46 |
import java.nio.ByteBuffer; |
|
47 |
import java.nio.MappedByteBuffer; |
|
48 |
import java.util.ArrayList; |
|
49 |
|
|
43 | 50 |
import com.iver.cit.gvsig.fmap.core.FMultiPoint2D; |
44 | 51 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
45 |
import com.iver.cit.gvsig.fmap.core.GeneralPathXIterator; |
|
46 | 52 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
47 | 53 |
import com.iver.cit.gvsig.fmap.core.IGeometry3D; |
48 | 54 |
import com.iver.cit.gvsig.fmap.core.v02.FConstant; |
49 | 55 |
import com.iver.cit.gvsig.fmap.drivers.shp.SHP; |
50 | 56 |
|
51 |
import java.awt.geom.Point2D; |
|
52 |
import java.awt.geom.Rectangle2D; |
|
53 | 57 |
|
54 |
import java.nio.ByteBuffer; |
|
55 |
import java.nio.MappedByteBuffer; |
|
56 |
import java.util.ArrayList; |
|
57 |
|
|
58 |
|
|
59 | 58 |
/** |
60 | 59 |
* Elemento shape de tipo multipunto. |
61 | 60 |
* |
... | ... | |
212 | 211 |
if (FConstant.SHAPE_TYPE_MULTIPOINTZ == m_type){ |
213 | 212 |
zs=((IGeometry3D)g).getZs(); |
214 | 213 |
} |
215 |
GeneralPathXIterator theIterator = g.getGeneralPathXIterator(); //polyLine.getPathIterator(null, flatness);
|
|
214 |
PathIterator theIterator = g.getPathIterator(null); //polyLine.getPathIterator(null, flatness);
|
|
216 | 215 |
double[] theData = new double[6]; |
217 | 216 |
ArrayList ps=new ArrayList(); |
218 | 217 |
while (!theIterator.isDone()) { |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/write/SHPPoint.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.drivers.shp.write; |
42 | 42 |
|
43 |
import java.awt.geom.PathIterator; |
|
44 |
import java.nio.ByteBuffer; |
|
45 |
import java.nio.MappedByteBuffer; |
|
46 |
|
|
43 | 47 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
44 |
import com.iver.cit.gvsig.fmap.core.GeneralPathXIterator; |
|
45 | 48 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
46 | 49 |
import com.iver.cit.gvsig.fmap.core.IGeometry3D; |
47 | 50 |
import com.iver.cit.gvsig.fmap.core.v02.FConstant; |
48 | 51 |
|
49 |
import java.nio.ByteBuffer; |
|
50 |
import java.nio.MappedByteBuffer; |
|
51 | 52 |
|
52 |
|
|
53 | 53 |
/** |
54 | 54 |
* DOCUMENT ME! |
55 | 55 |
* |
... | ... | |
160 | 160 |
if (FConstant.SHAPE_TYPE_POINTZ == m_type){ |
161 | 161 |
z=((IGeometry3D)g).getZs()[0]; |
162 | 162 |
} |
163 |
GeneralPathXIterator theIterator = g.getGeneralPathXIterator(); //polyLine.getPathIterator(null, flatness);
|
|
163 |
PathIterator theIterator = g.getPathIterator(null); //polyLine.getPathIterator(null, flatness);
|
|
164 | 164 |
double[] theData = new double[6]; |
165 | 165 |
|
166 | 166 |
while (!theIterator.isDone()) { |
trunk/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/engine/spatial/fmap/FMapGeometry.java | ||
---|---|---|
61 | 61 |
private GeneralPathX gpx = new GeneralPathX(); |
62 | 62 |
|
63 | 63 |
public FMapGeometry(IGeometry g) { |
64 |
gpx.append(g.getGeneralPathXIterator(), true);
|
|
64 |
gpx.append(g.getPathIterator(null), true);
|
|
65 | 65 |
} |
66 | 66 |
|
67 | 67 |
/** |
trunk/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/engine/spatial/fmap/AbstractFMapFileDriver.java | ||
---|---|---|
176 | 176 |
try { |
177 | 177 |
IGeometry ig = adapter.getShape((int)rowIndex); |
178 | 178 |
GeneralPathX gpx = new GeneralPathX(); |
179 |
gpx.append(ig.getGeneralPathXIterator(), true);
|
|
179 |
gpx.append(ig.getPathIterator(null), true);
|
|
180 | 180 |
return FConverter.java2d_to_jts(new FShapeGeneralPathX(gpx, ig.getGeometryType())); |
181 | 181 |
} catch (DriverIOException e) { |
182 | 182 |
throw new DriverException(e); |
Also available in: Unified diff