Revision 32810 branches/v2_0_0_prep/extensions/org.gvsig.symbology/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/impl/FSymbol.java
FSymbol.java | ||
---|---|---|
1097 | 1097 |
|
1098 | 1098 |
public boolean isOneDotOrPixel(Geometry geom, |
1099 | 1099 |
double[] positionOfDotOrPixel, ViewPort viewPort, int dpi) { |
1100 |
throw new UnsupportedOperationException("NOT IMPLEMENTED"); |
|
1100 |
int type = geom.getType(); |
|
1101 |
switch (type) { |
|
1102 |
case Geometry.TYPES.NULL: |
|
1103 |
case Geometry.TYPES.POINT: |
|
1104 |
case Geometry.TYPES.MULTIPOINT: |
|
1105 |
return false; |
|
1106 |
default: |
|
1107 |
org.gvsig.fmap.geom.primitive.Envelope geomBounds = geom |
|
1108 |
.getEnvelope(); |
|
1109 |
|
|
1110 |
double dist1Pixel = viewPort.getDist1pixel(); |
|
1111 |
|
|
1112 |
float[] distances = new float[2]; |
|
1113 |
this.getPixExtentPlus(geom, distances, viewPort, dpi); |
|
1114 |
|
|
1115 |
boolean onePoint = |
|
1116 |
(geomBounds.getLength(0) + distances[0] <= dist1Pixel && geomBounds |
|
1117 |
.getLength(1) |
|
1118 |
+ distances[1] <= dist1Pixel); |
|
1119 |
|
|
1120 |
if (onePoint) { |
|
1121 |
Rectangle bounds = geom.getBounds(); |
|
1122 |
positionOfDotOrPixel[0] = bounds.x; |
|
1123 |
positionOfDotOrPixel[1] = bounds.y; |
|
1124 |
} |
|
1125 |
return onePoint; |
|
1126 |
} |
|
1101 | 1127 |
} |
1102 | 1128 |
|
1103 | 1129 |
public Object clone() throws CloneNotSupportedException { |
Also available in: Unified diff