Revision 10820 trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/objects/DwgLwPolyline.java
DwgLwPolyline.java | ||
---|---|---|
40 | 40 |
import java.util.Map; |
41 | 41 |
|
42 | 42 |
import com.iver.cit.gvsig.fmap.core.FPolyline2D; |
43 |
import com.iver.cit.gvsig.fmap.core.FShape; |
|
43 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
44 |
import com.iver.cit.gvsig.fmap.core.ShapeFactory; |
|
44 | 45 |
import com.iver.cit.jdwglib.dwg.DwgFile; |
45 | 46 |
import com.iver.cit.jdwglib.dwg.DwgObject; |
46 | 47 |
import com.iver.cit.jdwglib.dwg.IDwg2FMap; |
... | ... | |
304 | 305 |
public double getZ() { |
305 | 306 |
return getElevation(); |
306 | 307 |
} |
307 |
public FShape toFMapGeometry(boolean is3DFile) {
|
|
308 |
public IGeometry toFMapGeometry(boolean is3DFile) {
|
|
308 | 309 |
FPolyline2D lwpline = null; |
309 | 310 |
List pts = getVertices(); |
310 | 311 |
double elev = getElevation(); |
... | ... | |
313 | 314 |
if (is3DFile) { |
314 | 315 |
List pline3D = new ArrayList(); |
315 | 316 |
for (int j = 0; j < pts.size(); j++) { |
317 |
Object vertex = pts.get(j); |
|
316 | 318 |
double[] pt = new double[3]; |
317 |
pt[0] = ((double[])pts.get(j))[0]; |
|
318 |
pt[1] = ((double[])pts.get(j))[1]; |
|
319 |
if(vertex instanceof double[]){ |
|
320 |
double[] vertexArray = (double[])vertex; |
|
321 |
pt[0] = vertexArray[0]; |
|
322 |
pt[1] = vertexArray[1]; |
|
323 |
}else if(vertex instanceof Point2D){ |
|
324 |
Point2D vertexPt = (Point2D)vertex; |
|
325 |
pt[0] = vertexPt.getX(); |
|
326 |
pt[1] = vertexPt.getY(); |
|
327 |
} |
|
319 | 328 |
pt[2] = elev; |
320 | 329 |
pline3D.add(pt); |
321 | 330 |
} |
... | ... | |
325 | 334 |
} |
326 | 335 |
|
327 | 336 |
} |
328 |
return lwpline;
|
|
337 |
return ShapeFactory.createGeometry(lwpline);
|
|
329 | 338 |
} |
330 | 339 |
public String toFMapString(boolean is3DFile) { |
331 | 340 |
if(is3DFile) |
Also available in: Unified diff