Revision 29001 branches/v2_0_0_prep/libraries/libDwg/src/org/gvsig/dwg/lib/objects/DwgPoint.java
DwgPoint.java | ||
---|---|---|
39 | 39 |
import org.gvsig.dwg.lib.IDwg3DTestable; |
40 | 40 |
import org.gvsig.dwg.lib.util.AcadExtrusionCalculator; |
41 | 41 |
import org.gvsig.fmap.geom.Geometry; |
42 |
import org.gvsig.fmap.geom.GeometryFactory;
|
|
42 |
import org.gvsig.fmap.geom.GeometryLocator;
|
|
43 | 43 |
import org.gvsig.fmap.geom.GeometryManager; |
44 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
45 |
import org.gvsig.fmap.geom.primitive.Point; |
|
44 | 46 |
|
45 | 47 |
|
46 | 48 |
/** |
... | ... | |
129 | 131 |
public double getZ() { |
130 | 132 |
return getPoint()[2]; |
131 | 133 |
} |
132 |
public Geometry toFMapGeometry(boolean is3DFile) { |
|
133 |
GeometryFactory gFactory = GeometryManager.getInstance().getGeometryFactory();
|
|
134 |
public Geometry toFMapGeometry(boolean is3DFile) throws CreateGeometryException {
|
|
135 |
GeometryManager gMan = GeometryLocator.getGeometryManager();
|
|
134 | 136 |
double[] p = getPoint(); |
135 |
if (is3DFile) { |
|
136 |
return gFactory.createPoint3D(p[0], p[1], p[2]); |
|
137 |
} else { |
|
138 |
return gFactory.createPoint2D(p[0], p[1]); |
|
139 |
} |
|
137 |
Point point = (Point) gMan.create(getGeometryType(), |
|
138 |
getGeometrySubType(is3DFile)); |
|
139 |
point.setCoordinates(p); |
|
140 |
return point; |
|
140 | 141 |
} |
141 | 142 |
|
142 | 143 |
public String toFMapString(boolean is3DFile) { |
143 |
if(is3DFile) |
|
144 |
if(is3DFile) {
|
|
144 | 145 |
return "FPoint3D"; |
145 |
else
|
|
146 |
} else {
|
|
146 | 147 |
return "FPoint2D"; |
148 |
} |
|
147 | 149 |
} |
148 | 150 |
|
149 | 151 |
public String toString(){ |
... | ... | |
168 | 170 |
myObj.setThickness(thickness); |
169 | 171 |
myObj.setXAxisAngle(xAxisAngle); |
170 | 172 |
} |
173 |
public int getGeometrySubType(boolean is3DFile) { |
|
174 |
if (is3DFile) { |
|
175 |
return Geometry.SUBTYPES.GEOM3D; |
|
176 |
} else { |
|
177 |
return Geometry.SUBTYPES.GEOM2D; |
|
178 |
} |
|
179 |
} |
|
171 | 180 |
|
181 |
public int getGeometryType() { |
|
182 |
return Geometry.TYPES.POINT; |
|
183 |
} |
|
184 |
|
|
172 | 185 |
} |
Also available in: Unified diff