Revision 29001 branches/v2_0_0_prep/libraries/libDwg/src/org/gvsig/dwg/lib/objects/DwgInsert.java
DwgInsert.java | ||
---|---|---|
42 | 42 |
import org.gvsig.dwg.lib.DwgFile; |
43 | 43 |
import org.gvsig.dwg.lib.DwgHandleReference; |
44 | 44 |
import org.gvsig.dwg.lib.DwgObject; |
45 |
import org.gvsig.dwg.lib.IDwg2FMap; |
|
46 | 45 |
import org.gvsig.dwg.lib.IDwg3DTestable; |
47 | 46 |
import org.gvsig.dwg.lib.IDwgBlockMember; |
48 | 47 |
import org.gvsig.dwg.lib.IDwgExtrusionable; |
49 | 48 |
import org.gvsig.dwg.lib.util.AcadExtrusionCalculator; |
50 | 49 |
import org.gvsig.fmap.geom.Geometry; |
51 |
import org.gvsig.fmap.geom.GeometryFactory;
|
|
50 |
import org.gvsig.fmap.geom.GeometryLocator;
|
|
52 | 51 |
import org.gvsig.fmap.geom.GeometryManager; |
52 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
53 |
import org.gvsig.fmap.geom.primitive.Point; |
|
53 | 54 |
|
54 | 55 |
|
55 | 56 |
/** |
... | ... | |
230 | 231 |
public double getZ() { |
231 | 232 |
return getInsertionPoint()[2]; |
232 | 233 |
} |
233 |
public Geometry toFMapGeometry(boolean is3DFile) { |
|
234 |
GeometryFactory gFactory = GeometryManager.getInstance().getGeometryFactory(); |
|
234 |
public Geometry toFMapGeometry(boolean is3DFile) |
|
235 |
throws CreateGeometryException { |
|
236 |
GeometryManager gMan = GeometryLocator.getGeometryManager(); |
|
235 | 237 |
double[] p = getInsertionPoint(); |
236 |
if (is3DFile) { |
|
237 |
return gFactory.createPoint3D(p[0], p[1], p[2]); |
|
238 |
} else { |
|
239 |
return gFactory.createPoint2D(p[0], p[1]); |
|
240 |
} |
|
238 |
Point point = (Point) gMan.create(getGeometryType(), |
|
239 |
getGeometrySubType(is3DFile)); |
|
240 |
point.setCoordinates(p); |
|
241 |
return point; |
|
241 | 242 |
|
242 | 243 |
} |
243 | 244 |
public String toFMapString(boolean is3DFile) { |
244 |
if(is3DFile) |
|
245 |
if(is3DFile) {
|
|
245 | 246 |
return "FPoint3D"; |
246 |
else
|
|
247 |
} else {
|
|
247 | 248 |
return "FPoint2D"; |
249 |
} |
|
248 | 250 |
} |
249 | 251 |
|
250 | 252 |
public String toString(){ |
... | ... | |
314 | 316 |
this.processed = processed; |
315 | 317 |
} |
316 | 318 |
|
319 |
public int getGeometrySubType(boolean is3DFile) { |
|
320 |
if (is3DFile) { |
|
321 |
return Geometry.SUBTYPES.GEOM3D; |
|
322 |
} else { |
|
323 |
return Geometry.SUBTYPES.GEOM2D; |
|
324 |
} |
|
325 |
} |
|
326 |
|
|
327 |
public int getGeometryType() { |
|
328 |
return Geometry.TYPES.POINT; |
|
329 |
} |
|
317 | 330 |
} |
Also available in: Unified diff