Revision 42875 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.jts/src/main/java/org/gvsig/fmap/geom/jts/primitive/surface/polygon/Polygon3D.java
Polygon3D.java | ||
---|---|---|
267 | 267 |
closePrimitive(); |
268 | 268 |
} |
269 | 269 |
} |
270 |
|
|
271 |
@Override |
|
272 |
public boolean equals(Object obj) { |
|
273 |
boolean res = super.equals(obj); |
|
274 |
if(res && obj instanceof Polygon3D){ |
|
275 |
Polygon3D other = (Polygon3D)obj; |
|
276 |
if(this.getNumVertices() != other.getNumVertices()){ |
|
277 |
return false; |
|
278 |
} |
|
279 |
for (int i = 0; i < this.getNumVertices(); i++) { |
|
280 |
Coordinate coordinate = this.coordinates.get(i); |
|
281 |
Coordinate otherCoordinate = other.coordinates.get(i); |
|
282 |
if (otherCoordinate.getOrdinate(2) != coordinate.getOrdinate(2)) { |
|
283 |
return false; |
|
284 |
} |
|
285 |
} |
|
286 |
if(this.getNumInteriorRings() != other.getNumInteriorRings()){ |
|
287 |
return false; |
|
288 |
} |
|
289 |
for(int i=0; i < this.getNumInteriorRings(); i++){ |
|
290 |
if(!other.getInteriorRing(i).equals(this.getInteriorRing(i))){ |
|
291 |
return false; |
|
292 |
} |
|
293 |
} |
|
294 |
return true; |
|
295 |
} else { |
|
296 |
return false; |
|
297 |
} |
|
298 |
} |
|
299 |
|
|
270 | 300 |
} |
Also available in: Unified diff