Revision 42283 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/aggregate/MultiLine3D.java
MultiLine3D.java | ||
---|---|---|
146 | 146 |
* @see org.gvsig.fmap.geom.jts.aggregate.AbstractMultiLine#fixLine(org.gvsig.fmap.geom.primitive.Line) |
147 | 147 |
*/ |
148 | 148 |
@Override |
149 |
protected Primitive fixPrimitive(Primitive curve) { |
|
150 |
if(!(curve instanceof Line3D)){ |
|
151 |
String message = "Only Line3D primitives can be added to a MultiLine3D"; |
|
152 |
notifyDeprecated(message); |
|
153 |
throw new UnsupportedOperationException(message); |
|
149 |
protected Geometry fixPrimitive(Primitive primitive) { |
|
150 |
if(primitive instanceof Line3D){ |
|
151 |
return primitive; |
|
154 | 152 |
} |
155 |
return curve; |
|
153 |
|
|
154 |
if(primitive.getGeometryType().getSubType() == Geometry.SUBTYPES.GEOM3D){ |
|
155 |
try { |
|
156 |
return primitive.toLines(); |
|
157 |
} catch (GeometryException e) { |
|
158 |
String message = "Can't convert primitive to lines"; |
|
159 |
logger.warn(message); |
|
160 |
throw new RuntimeException(message); |
|
161 |
} |
|
162 |
} |
|
163 |
|
|
164 |
String message = "Only 3D primitives can be fixed to MultiLine3D"; |
|
165 |
notifyDeprecated(message); |
|
166 |
throw new UnsupportedOperationException(message); |
|
156 | 167 |
} |
157 | 168 |
} |
Also available in: Unified diff